easypost 3.5.1 → 5.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/.gitattributes +9 -0
- data/.github/CODEOWNERS +2 -0
- data/.github/ISSUE_TEMPLATE/bug_report.yml +81 -0
- data/.github/ISSUE_TEMPLATE/feature_request.yml +37 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +22 -0
- data/.github/workflows/ci.yml +54 -5
- data/.gitignore +27 -17
- data/.gitmodules +3 -0
- data/CHANGELOG.md +295 -119
- data/Gemfile +2 -0
- data/Makefile +70 -0
- data/README.md +184 -72
- data/Rakefile +2 -1
- data/UPGRADE_GUIDE.md +181 -0
- data/VERSION +1 -1
- data/bin/easypost-irb +5 -3
- data/easypost.gemspec +27 -20
- data/lib/easypost/client.rb +179 -0
- data/lib/easypost/connection.rb +64 -0
- data/lib/easypost/constants.rb +15 -0
- data/lib/easypost/errors/api/api_error.rb +108 -0
- data/lib/easypost/errors/api/bad_request_error.rb +6 -0
- data/lib/easypost/errors/api/connection_error.rb +6 -0
- data/lib/easypost/errors/api/external_api_error.rb +18 -0
- data/lib/easypost/errors/api/forbidden_error.rb +6 -0
- data/lib/easypost/errors/api/gateway_timeout_error.rb +6 -0
- data/lib/easypost/errors/api/internal_server_error.rb +6 -0
- data/lib/easypost/errors/api/invalid_request_error.rb +6 -0
- data/lib/easypost/errors/api/method_not_allowed_error.rb +6 -0
- data/lib/easypost/errors/api/not_found_error.rb +6 -0
- data/lib/easypost/errors/api/payment_error.rb +6 -0
- data/lib/easypost/errors/api/proxy_error.rb +6 -0
- data/lib/easypost/errors/api/rate_limit_error.rb +6 -0
- data/lib/easypost/errors/api/redirect_error.rb +6 -0
- data/lib/easypost/errors/api/retry_error.rb +6 -0
- data/lib/easypost/errors/api/service_unavailable_error.rb +6 -0
- data/lib/easypost/errors/api/ssl_error.rb +6 -0
- data/lib/easypost/errors/api/timeout_error.rb +6 -0
- data/lib/easypost/errors/api/unauthorized_error.rb +6 -0
- data/lib/easypost/errors/api/unknown_api_error.rb +6 -0
- data/lib/easypost/errors/easy_post_error.rb +7 -0
- data/lib/easypost/errors/end_of_pagination_error.rb +7 -0
- data/lib/easypost/errors/filtering_error.rb +4 -0
- data/lib/easypost/errors/invalid_object_error.rb +4 -0
- data/lib/easypost/errors/invalid_parameter_error.rb +11 -0
- data/lib/easypost/errors/missing_parameter_error.rb +9 -0
- data/lib/easypost/errors/signature_verification_error.rb +4 -0
- data/lib/easypost/errors.rb +32 -0
- data/lib/easypost/hooks/request_context.rb +16 -0
- data/lib/easypost/hooks/response_context.rb +23 -0
- data/lib/easypost/hooks.rb +34 -0
- data/lib/easypost/http_client.rb +117 -0
- data/lib/easypost/internal_utilities.rb +66 -0
- data/lib/easypost/models/address.rb +5 -0
- data/lib/easypost/models/api_key.rb +5 -0
- data/lib/easypost/models/base.rb +58 -0
- data/lib/easypost/models/batch.rb +5 -0
- data/lib/easypost/models/brand.rb +5 -0
- data/lib/easypost/models/carbon_offset.rb +5 -0
- data/lib/easypost/models/carrier_account.rb +5 -0
- data/lib/easypost/models/carrier_type.rb +5 -0
- data/lib/easypost/models/customs_info.rb +5 -0
- data/lib/easypost/models/customs_item.rb +5 -0
- data/lib/easypost/models/end_shipper.rb +5 -0
- data/lib/easypost/models/error.rb +21 -0
- data/lib/easypost/models/event.rb +5 -0
- data/lib/easypost/models/insurance.rb +6 -0
- data/lib/easypost/models/order.rb +9 -0
- data/lib/easypost/models/parcel.rb +5 -0
- data/lib/easypost/models/payload.rb +5 -0
- data/lib/easypost/models/payment_method.rb +5 -0
- data/lib/easypost/models/pickup.rb +9 -0
- data/lib/easypost/models/pickup_rate.rb +5 -0
- data/lib/easypost/models/postage_label.rb +5 -0
- data/lib/easypost/models/rate.rb +5 -0
- data/lib/easypost/models/referral.rb +5 -0
- data/lib/easypost/models/refund.rb +5 -0
- data/lib/easypost/models/report.rb +5 -0
- data/lib/easypost/models/scan_form.rb +6 -0
- data/lib/easypost/models/shipment.rb +10 -0
- data/lib/easypost/models/tax_identifier.rb +6 -0
- data/lib/easypost/models/tracker.rb +5 -0
- data/lib/easypost/models/user.rb +5 -0
- data/lib/easypost/models/webhook.rb +6 -0
- data/lib/easypost/models.rb +36 -0
- data/lib/easypost/services/address.rb +50 -0
- data/lib/easypost/services/api_key.rb +8 -0
- data/lib/easypost/services/base.rb +27 -0
- data/lib/easypost/services/batch.rb +53 -0
- data/lib/easypost/services/beta_rate.rb +12 -0
- data/lib/easypost/services/beta_referral_customer.rb +40 -0
- data/lib/easypost/services/billing.rb +75 -0
- data/lib/easypost/services/carrier_account.rb +44 -0
- data/lib/easypost/services/carrier_metadata.rb +22 -0
- data/lib/easypost/services/carrier_type.rb +10 -0
- data/lib/easypost/services/customs_info.rb +17 -0
- data/lib/easypost/services/customs_item.rb +15 -0
- data/lib/easypost/services/end_shipper.rb +31 -0
- data/lib/easypost/services/event.rb +32 -0
- data/lib/easypost/services/insurance.rb +26 -0
- data/lib/easypost/services/order.rb +30 -0
- data/lib/easypost/services/parcel.rb +16 -0
- data/lib/easypost/services/pickup.rb +40 -0
- data/lib/easypost/services/rate.rb +8 -0
- data/lib/easypost/services/referral_customer.rb +103 -0
- data/lib/easypost/services/refund.rb +26 -0
- data/lib/easypost/services/report.rb +42 -0
- data/lib/easypost/services/scan_form.rb +25 -0
- data/lib/easypost/services/shipment.rb +106 -0
- data/lib/easypost/services/tracker.rb +38 -0
- data/lib/easypost/services/user.rb +66 -0
- data/lib/easypost/services/webhook.rb +34 -0
- data/lib/easypost/services.rb +33 -0
- data/lib/easypost/util.rb +160 -116
- data/lib/easypost/utilities/constants.rb +5 -0
- data/lib/easypost/utilities/json.rb +23 -0
- data/lib/easypost/utilities/static_mapper.rb +73 -0
- data/lib/easypost/utilities/system.rb +36 -0
- data/lib/easypost/version.rb +3 -1
- data/lib/easypost.rb +20 -143
- metadata +249 -46
- data/lib/easypost/address.rb +0 -58
- data/lib/easypost/api_key.rb +0 -2
- data/lib/easypost/batch.rb +0 -49
- data/lib/easypost/brand.rb +0 -9
- data/lib/easypost/carrier_account.rb +0 -5
- data/lib/easypost/carrier_type.rb +0 -2
- data/lib/easypost/customs_info.rb +0 -5
- data/lib/easypost/customs_item.rb +0 -5
- data/lib/easypost/error.rb +0 -31
- data/lib/easypost/event.rb +0 -7
- data/lib/easypost/insurance.rb +0 -2
- data/lib/easypost/object.rb +0 -151
- data/lib/easypost/order.rb +0 -28
- data/lib/easypost/parcel.rb +0 -2
- data/lib/easypost/pickup.rb +0 -26
- data/lib/easypost/pickup_rate.rb +0 -3
- data/lib/easypost/postage_label.rb +0 -2
- data/lib/easypost/print_job.rb +0 -2
- data/lib/easypost/printer.rb +0 -24
- data/lib/easypost/rate.rb +0 -2
- data/lib/easypost/refund.rb +0 -2
- data/lib/easypost/report.rb +0 -29
- data/lib/easypost/resource.rb +0 -75
- data/lib/easypost/scan_form.rb +0 -6
- data/lib/easypost/shipment.rb +0 -129
- data/lib/easypost/tax_identifier.rb +0 -2
- data/lib/easypost/tracker.rb +0 -7
- data/lib/easypost/user.rb +0 -56
- data/lib/easypost/webhook.rb +0 -29
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 043543a947c3d50354a25d984eded8e68e37d9af9d7e2c6158176201426cafa1
|
|
4
|
+
data.tar.gz: 15ebc3486ec63ac23b0dfa6de82001537a72697863e1587fd9a1d909cde33a9a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8a004acaa7797b54fd7226e4321a47e9aaa11aa055ee39dd886456d547f3e9ec847046c77f2f548a3f510c9d992842c4896fcb5beb6ee060280098e87ee2ae40
|
|
7
|
+
data.tar.gz: 7b4f5377749b4d65278f744befef446cfcfe7372f171e64a6b42996b9c0c988b0a6370f949d2986698fc5484f66d4bc3cb879b0f714b04a25e9216c196d960ee
|
data/.gitattributes
ADDED
data/.github/CODEOWNERS
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
name: Bug Report
|
|
2
|
+
description: File a bug report
|
|
3
|
+
title: "[Bug]: "
|
|
4
|
+
labels: [ "triage" ]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Thank you for taking the time to report an issue in this repository. Please fill out the form below.
|
|
10
|
+
- type: input
|
|
11
|
+
id: software-version
|
|
12
|
+
attributes:
|
|
13
|
+
label: Software Version
|
|
14
|
+
# change this description for the specific repo
|
|
15
|
+
description: |
|
|
16
|
+
What version of our software are you running?
|
|
17
|
+
TIP: [Available versions](https://github.com/EasyPost/easypost-ruby/releases)
|
|
18
|
+
validations:
|
|
19
|
+
required: true
|
|
20
|
+
- type: input
|
|
21
|
+
id: language-version
|
|
22
|
+
attributes:
|
|
23
|
+
label: Language Version
|
|
24
|
+
# change this description for the specific language of the repo
|
|
25
|
+
description: |
|
|
26
|
+
What language version and/or framework are you using?
|
|
27
|
+
TIP: [How to find your Ruby version](https://blog.arkency.com/which-ruby-version-am-i-using-how-to-check/)
|
|
28
|
+
validations:
|
|
29
|
+
required: true
|
|
30
|
+
- type: input
|
|
31
|
+
id: os
|
|
32
|
+
attributes:
|
|
33
|
+
label: Operating System
|
|
34
|
+
description: What operating system are you running the software on?
|
|
35
|
+
validations:
|
|
36
|
+
required: true
|
|
37
|
+
- type: textarea
|
|
38
|
+
id: behavior
|
|
39
|
+
attributes:
|
|
40
|
+
label: What happened?
|
|
41
|
+
description: |
|
|
42
|
+
Please describe what happened in reproducible steps.
|
|
43
|
+
Include how often you see this issue, and any relevant links (i.e. GitHub issue, Stack Overflow, etc.).
|
|
44
|
+
value: |
|
|
45
|
+
1.
|
|
46
|
+
2.
|
|
47
|
+
3.
|
|
48
|
+
...
|
|
49
|
+
validations:
|
|
50
|
+
required: true
|
|
51
|
+
- type: textarea
|
|
52
|
+
id: expected-behavior
|
|
53
|
+
attributes:
|
|
54
|
+
label: What was expected?
|
|
55
|
+
description: Please describe what was expected to happen instead.
|
|
56
|
+
validations:
|
|
57
|
+
required: true
|
|
58
|
+
- type: textarea
|
|
59
|
+
id: sample-code
|
|
60
|
+
attributes:
|
|
61
|
+
label: Sample Code
|
|
62
|
+
description: |
|
|
63
|
+
Please provide any sample code that demonstrates the behavior.
|
|
64
|
+
This will be automatically formatted into the appropriate language, so no need for backticks.
|
|
65
|
+
**Do not include any private information such as API keys or passwords.**
|
|
66
|
+
# change this render to the appropriate language: https://github.com/github/linguist/blob/master/lib/linguist/languages.yml
|
|
67
|
+
render: rb
|
|
68
|
+
validations:
|
|
69
|
+
required: false
|
|
70
|
+
- type: textarea
|
|
71
|
+
id: logs
|
|
72
|
+
attributes:
|
|
73
|
+
label: Relevant logs
|
|
74
|
+
description: |
|
|
75
|
+
Please copy and paste any relevant log output.
|
|
76
|
+
This will be automatically formatted into shell output, so no need for backticks.
|
|
77
|
+
If you have screenshots instead, please paste them below.
|
|
78
|
+
**Do not include any private information such as API keys or passwords.**
|
|
79
|
+
render: sh
|
|
80
|
+
validations:
|
|
81
|
+
required: false
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: Feature Request
|
|
2
|
+
description: Request a new feature
|
|
3
|
+
title: "[Feat]: "
|
|
4
|
+
labels: [ "triage" ]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Thank you for taking the time to request a new feature.
|
|
10
|
+
Please note, all feature requests are subject to review and approval.
|
|
11
|
+
We welcome all suggestions and ideas, but we cannot guarantee when or if we will implement them.
|
|
12
|
+
|
|
13
|
+
We also welcome pull requests, if you would like to implement the feature yourself.
|
|
14
|
+
Doing so will likely accelerate the process of implementing the requested feature.
|
|
15
|
+
- type: checkboxes
|
|
16
|
+
id: searched
|
|
17
|
+
attributes:
|
|
18
|
+
label: Feature Request Is New
|
|
19
|
+
# change issue link below for the specific repo
|
|
20
|
+
description: |
|
|
21
|
+
Before we begin, please confirm that the requested feature does not already exist or has not [already been requested](https://github.com/EasyPost/easypost-ruby/issues).
|
|
22
|
+
options:
|
|
23
|
+
- label: I have verified that the requested feature does not already exist or has not already been requested.
|
|
24
|
+
required: true
|
|
25
|
+
- type: textarea
|
|
26
|
+
id: description
|
|
27
|
+
attributes:
|
|
28
|
+
label: Description of the feature
|
|
29
|
+
description: |
|
|
30
|
+
Please provide a detailed description of the feature, including:
|
|
31
|
+
- What the feature is
|
|
32
|
+
- What value it adds to the application
|
|
33
|
+
- How it should be implemented (i.e. pseudo-code, or a high-level description of the user experience)
|
|
34
|
+
- Any other relevant information
|
|
35
|
+
validations:
|
|
36
|
+
required: true
|
|
37
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Description
|
|
2
|
+
|
|
3
|
+
<!-- Please provide a general summary of your PR changes and link any related issues or other pull requests. -->
|
|
4
|
+
|
|
5
|
+
# Testing
|
|
6
|
+
|
|
7
|
+
<!--
|
|
8
|
+
Please provide details on how you tested this code. See below.
|
|
9
|
+
|
|
10
|
+
- All pull requests must be tested (unit tests where possible with accompanying cassettes, or provide a screenshot of end-to-end testing when unit tests are not possible)
|
|
11
|
+
- New features must get a new unit test
|
|
12
|
+
- Bug fixes/refactors must re-record existing cassettes
|
|
13
|
+
-->
|
|
14
|
+
|
|
15
|
+
# Pull Request Type
|
|
16
|
+
|
|
17
|
+
Please select the option(s) that are relevant to this PR.
|
|
18
|
+
|
|
19
|
+
- [ ] Bug fix (non-breaking change which fixes an issue)
|
|
20
|
+
- [ ] New feature (non-breaking change which adds functionality)
|
|
21
|
+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
|
22
|
+
- [ ] Improvement (fixing a typo, updating readme, renaming a variable name, etc)
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -2,21 +2,70 @@ name: 'CI'
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
|
-
branches: [
|
|
5
|
+
branches: [master]
|
|
6
6
|
pull_request: ~
|
|
7
|
+
workflow_dispatch: ~
|
|
7
8
|
|
|
8
9
|
jobs:
|
|
9
10
|
run-tests:
|
|
10
11
|
runs-on: ubuntu-latest
|
|
11
12
|
strategy:
|
|
12
13
|
matrix:
|
|
13
|
-
rubyversion: ['2.
|
|
14
|
+
rubyversion: ['2.6', '2.7', '3.0', '3.1', '3.2']
|
|
14
15
|
steps:
|
|
15
|
-
-
|
|
16
|
-
|
|
16
|
+
- name: Checkout Repository
|
|
17
|
+
uses: actions/checkout@v3
|
|
18
|
+
- name: Set up Ruby
|
|
17
19
|
uses: ruby/setup-ruby@v1
|
|
18
20
|
with:
|
|
19
21
|
ruby-version: ${{ matrix.rubyversion }}
|
|
22
|
+
rubygems: '3.0.0'
|
|
20
23
|
bundler-cache: true
|
|
24
|
+
- name: Install Dependencies
|
|
25
|
+
run: make install
|
|
21
26
|
- name: run tests
|
|
22
|
-
run:
|
|
27
|
+
run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make test
|
|
28
|
+
- name: Coveralls
|
|
29
|
+
if: github.ref == 'refs/heads/master'
|
|
30
|
+
uses: coverallsapp/github-action@master
|
|
31
|
+
with:
|
|
32
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
33
|
+
path-to-lcov: './coverage/lcov/easypost-ruby.lcov'
|
|
34
|
+
lint:
|
|
35
|
+
runs-on: ubuntu-latest
|
|
36
|
+
steps:
|
|
37
|
+
- name: Checkout Repository
|
|
38
|
+
uses: actions/checkout@v3
|
|
39
|
+
- name: Set up Ruby
|
|
40
|
+
uses: ruby/setup-ruby@v1
|
|
41
|
+
with:
|
|
42
|
+
ruby-version: '3.2'
|
|
43
|
+
rubygems: '3.0.0'
|
|
44
|
+
bundler-cache: true
|
|
45
|
+
- name: Install Dependencies
|
|
46
|
+
run: make install
|
|
47
|
+
- name: Install style guides
|
|
48
|
+
run: make install-styleguide
|
|
49
|
+
- name: Lint Project
|
|
50
|
+
run: make lint
|
|
51
|
+
docs:
|
|
52
|
+
if: github.ref == 'refs/heads/master'
|
|
53
|
+
runs-on: ubuntu-latest
|
|
54
|
+
steps:
|
|
55
|
+
- name: Checkout Repository
|
|
56
|
+
uses: actions/checkout@v3
|
|
57
|
+
- name: Set up Ruby
|
|
58
|
+
uses: ruby/setup-ruby@v1
|
|
59
|
+
with:
|
|
60
|
+
ruby-version: '3.2'
|
|
61
|
+
rubygems: '3.0.0'
|
|
62
|
+
bundler-cache: true
|
|
63
|
+
- name: Install Dependencies
|
|
64
|
+
run: make install
|
|
65
|
+
- name: Generate Docs
|
|
66
|
+
run: make docs
|
|
67
|
+
- name: Deploy docs
|
|
68
|
+
uses: peaceiris/actions-gh-pages@v3
|
|
69
|
+
with:
|
|
70
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
71
|
+
publish_dir: docs
|
data/.gitignore
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
._*
|
|
2
|
+
.AppleDouble
|
|
3
3
|
.bundle
|
|
4
4
|
.config
|
|
5
|
-
|
|
5
|
+
.DS_Store
|
|
6
|
+
.env
|
|
7
|
+
.idea/
|
|
8
|
+
.LSOverride
|
|
9
|
+
.Spotlight-V100
|
|
10
|
+
.Trashes
|
|
11
|
+
*.gem
|
|
12
|
+
*.rbc
|
|
6
13
|
coverage
|
|
14
|
+
dist
|
|
15
|
+
docs
|
|
16
|
+
Gemfile.lock
|
|
17
|
+
Icon
|
|
7
18
|
InstalledFiles
|
|
8
19
|
lib/bundler/man
|
|
9
20
|
pkg
|
|
@@ -12,18 +23,17 @@ spec/reports
|
|
|
12
23
|
test/tmp
|
|
13
24
|
test/version_tmp
|
|
14
25
|
tmp
|
|
15
|
-
|
|
16
|
-
# YARD artifacts
|
|
17
|
-
.yardoc
|
|
18
|
-
_yardoc
|
|
19
|
-
doc/
|
|
20
|
-
|
|
21
|
-
# iOS
|
|
22
|
-
.DS_Store
|
|
23
|
-
.AppleDouble
|
|
24
|
-
.LSOverride
|
|
25
|
-
Icon
|
|
26
|
-
._*
|
|
27
|
-
.Spotlight-V100
|
|
28
|
-
.Trashes
|
|
29
26
|
vendor/
|
|
27
|
+
/easycop.yml
|
|
28
|
+
/.rubocop.yml
|
|
29
|
+
[._]*.s[a-v][a-z]
|
|
30
|
+
[._]*.sw[a-p]
|
|
31
|
+
[._]s[a-rt-v][a-z]
|
|
32
|
+
[._]ss[a-gi-z]
|
|
33
|
+
[._]sw[a-p]
|
|
34
|
+
Session.vim
|
|
35
|
+
Sessionx.vim
|
|
36
|
+
.netrwhist
|
|
37
|
+
*~
|
|
38
|
+
tags
|
|
39
|
+
[._]*.un~
|
data/.gitmodules
ADDED