easypost 7.3.0 → 7.4.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/.github/CODEOWNERS +1 -1
- data/.github/workflows/ci.yml +14 -11
- data/.github/workflows/release.yml +3 -2
- data/CHANGELOG.md +9 -0
- data/README.md +9 -9
- data/VERSION +1 -1
- data/easypost.gemspec +3 -1
- data/justfile +70 -0
- data/lib/easypost/services/api_key.rb +32 -1
- data/lib/easypost/services/tracker.rb +8 -0
- metadata +18 -4
- data/Makefile +0 -75
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1818317cd00bce2eb87d53600db69d6360f3058f801b468145824588ccd8c3f7
|
|
4
|
+
data.tar.gz: 5c84f10ef3bbb23b0b27373c6b52dcb5e9578cdf7caed6c1e73736561ad5afe8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 16d6abe782e6607bad93751ec128b8ff536f5286e9311ecefce68eb3b7d5adba14f898ad813df6f2bd8b3a681a9b32a8daf15bad7258aa0cc21dd1540f2b7bd6
|
|
7
|
+
data.tar.gz: b3bfe47a25eab2732c9cbf80034518c303e788921109f9e7c731e6aecfeeb254fca6d25bbd093d92ec377106c75792d7c372226e16a883d8e78c3ed49428b871
|
data/.github/CODEOWNERS
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
## These are the standard rules for all EasyPost public repositories.
|
|
2
2
|
##
|
|
3
3
|
|
|
4
|
-
* @EasyPost/
|
|
4
|
+
* @EasyPost/dev-tools @EasyPost/easypost-public-maintainers
|
|
5
5
|
|
|
6
6
|
# The devtools team owns the codeowners file, this is for auditing purposes
|
|
7
7
|
.github/CODEOWNERS @easypost/dev-tools
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -11,18 +11,19 @@ jobs:
|
|
|
11
11
|
runs-on: ubuntu-latest
|
|
12
12
|
strategy:
|
|
13
13
|
matrix:
|
|
14
|
-
rubyversion: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4']
|
|
14
|
+
rubyversion: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4', '4.0']
|
|
15
15
|
steps:
|
|
16
|
-
- uses: actions/checkout@
|
|
16
|
+
- uses: actions/checkout@v6
|
|
17
|
+
- uses: extractions/setup-just@v3
|
|
17
18
|
- uses: ruby/setup-ruby@v1
|
|
18
19
|
with:
|
|
19
20
|
ruby-version: ${{ matrix.rubyversion }}
|
|
20
21
|
rubygems: '3.4.0'
|
|
21
22
|
bundler-cache: true
|
|
22
23
|
- name: Install Dependencies
|
|
23
|
-
run:
|
|
24
|
+
run: just install
|
|
24
25
|
- name: run tests
|
|
25
|
-
run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123
|
|
26
|
+
run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just test
|
|
26
27
|
- name: Coveralls
|
|
27
28
|
if: github.ref == 'refs/heads/master'
|
|
28
29
|
uses: coverallsapp/github-action@master
|
|
@@ -32,32 +33,34 @@ jobs:
|
|
|
32
33
|
lint:
|
|
33
34
|
runs-on: ubuntu-latest
|
|
34
35
|
steps:
|
|
35
|
-
- uses: actions/checkout@
|
|
36
|
+
- uses: actions/checkout@v6
|
|
37
|
+
- uses: extractions/setup-just@v3
|
|
36
38
|
- uses: ruby/setup-ruby@v1
|
|
37
39
|
with:
|
|
38
40
|
ruby-version: '3.4'
|
|
39
41
|
rubygems: '3.3.0'
|
|
40
42
|
bundler-cache: true
|
|
41
43
|
- name: Install Dependencies
|
|
42
|
-
run:
|
|
44
|
+
run: just install
|
|
43
45
|
- name: Install style guides
|
|
44
|
-
run:
|
|
46
|
+
run: just install-styleguide
|
|
45
47
|
- name: Lint Project
|
|
46
|
-
run:
|
|
48
|
+
run: just lint
|
|
47
49
|
docs:
|
|
48
50
|
if: github.ref == 'refs/heads/master'
|
|
49
51
|
runs-on: ubuntu-latest
|
|
50
52
|
steps:
|
|
51
|
-
- uses: actions/checkout@
|
|
53
|
+
- uses: actions/checkout@v6
|
|
54
|
+
- uses: extractions/setup-just@v3
|
|
52
55
|
- uses: ruby/setup-ruby@v1
|
|
53
56
|
with:
|
|
54
57
|
ruby-version: '3.4'
|
|
55
58
|
rubygems: '3.3.0'
|
|
56
59
|
bundler-cache: true
|
|
57
60
|
- name: Install Dependencies
|
|
58
|
-
run:
|
|
61
|
+
run: just install
|
|
59
62
|
- name: Generate Docs
|
|
60
|
-
run:
|
|
63
|
+
run: just docs
|
|
61
64
|
- name: Deploy docs
|
|
62
65
|
uses: peaceiris/actions-gh-pages@v3
|
|
63
66
|
with:
|
|
@@ -9,14 +9,15 @@ jobs:
|
|
|
9
9
|
release:
|
|
10
10
|
runs-on: ubuntu-latest
|
|
11
11
|
steps:
|
|
12
|
-
- uses: actions/checkout@
|
|
12
|
+
- uses: actions/checkout@v6
|
|
13
|
+
- uses: extractions/setup-just@v3
|
|
13
14
|
- uses: ruby/setup-ruby@v1
|
|
14
15
|
with:
|
|
15
16
|
ruby-version: '3.4'
|
|
16
17
|
rubygems: '3.3.0'
|
|
17
18
|
bundler-cache: true
|
|
18
19
|
- name: Build Package
|
|
19
|
-
run:
|
|
20
|
+
run: just install build
|
|
20
21
|
- name: Publish to RubyGems
|
|
21
22
|
run: |
|
|
22
23
|
mkdir -p $HOME/.gem
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## v7.4.0 (2026-02-02)
|
|
4
|
+
|
|
5
|
+
- Adds the following functions usable by child and referral customer users:
|
|
6
|
+
- `api_key.create`
|
|
7
|
+
- `api_key.delete`
|
|
8
|
+
- `api_key.enable`
|
|
9
|
+
- `api_key.disable`
|
|
10
|
+
- Adds a `tracker.delete` function
|
|
11
|
+
|
|
3
12
|
## v7.3.0 (2025-11-24)
|
|
4
13
|
|
|
5
14
|
- Adds the following functions:
|
data/README.md
CHANGED
|
@@ -165,7 +165,7 @@ If you're using a custom HTTP connection, keep in mind that the `response_data`
|
|
|
165
165
|
|
|
166
166
|
API documentation can be found at: <https://docs.easypost.com>.
|
|
167
167
|
|
|
168
|
-
Library documentation can be found on the web at: <https://easypost.github.io/easypost-ruby/> or by building them locally via the `
|
|
168
|
+
Library documentation can be found on the web at: <https://easypost.github.io/easypost-ruby/> or by building them locally via the `just docs` command.
|
|
169
169
|
|
|
170
170
|
Upgrading major versions of this project? Refer to the [Upgrade Guide](UPGRADE_GUIDE.md).
|
|
171
171
|
|
|
@@ -179,26 +179,26 @@ For additional support, see our [org-wide support policy](https://github.com/Eas
|
|
|
179
179
|
|
|
180
180
|
```bash
|
|
181
181
|
# Install dependencies
|
|
182
|
-
|
|
182
|
+
just install
|
|
183
183
|
|
|
184
184
|
# Install style guide (Unix only)
|
|
185
|
-
|
|
185
|
+
just install-style
|
|
186
186
|
|
|
187
187
|
# Lint project
|
|
188
|
-
|
|
189
|
-
|
|
188
|
+
just lint
|
|
189
|
+
just lint-fix
|
|
190
190
|
|
|
191
191
|
# Run tests (coverage is generated on a successful test suite run)
|
|
192
|
-
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123...
|
|
192
|
+
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... just test
|
|
193
193
|
|
|
194
194
|
# Run security analysis
|
|
195
|
-
|
|
195
|
+
just scan
|
|
196
196
|
|
|
197
197
|
# Generate library documentation
|
|
198
|
-
|
|
198
|
+
just docs
|
|
199
199
|
|
|
200
200
|
# Update submodules
|
|
201
|
-
|
|
201
|
+
just update-examples-submodule
|
|
202
202
|
```
|
|
203
203
|
|
|
204
204
|
### Testing
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
7.
|
|
1
|
+
7.4.0
|
data/easypost.gemspec
CHANGED
|
@@ -20,6 +20,8 @@ Gem::Specification.new do |spec|
|
|
|
20
20
|
spec.require_paths = ['lib']
|
|
21
21
|
spec.required_ruby_version = '>= 2.7'
|
|
22
22
|
|
|
23
|
+
spec.add_dependency 'base64', '~> 0.3'
|
|
24
|
+
|
|
23
25
|
spec.add_development_dependency 'abbrev', '~> 0.1'
|
|
24
26
|
spec.add_development_dependency 'benchmark', '~> 0.4'
|
|
25
27
|
spec.add_development_dependency 'bigdecimal', '~> 3'
|
|
@@ -34,6 +36,6 @@ Gem::Specification.new do |spec|
|
|
|
34
36
|
spec.add_development_dependency 'simplecov', '~> 0.22'
|
|
35
37
|
spec.add_development_dependency 'simplecov-lcov', '~> 0.8'
|
|
36
38
|
spec.add_development_dependency 'typhoeus', '~> 1.4'
|
|
37
|
-
spec.add_development_dependency 'vcr', '~> 6.
|
|
39
|
+
spec.add_development_dependency 'vcr', '~> 6.4'
|
|
38
40
|
spec.add_development_dependency 'webmock', '~> 3.25'
|
|
39
41
|
end
|
data/justfile
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Builds the project
|
|
2
|
+
build:
|
|
3
|
+
gem build easypost.gemspec --strict
|
|
4
|
+
mkdir -p dist
|
|
5
|
+
mv *.gem dist/
|
|
6
|
+
|
|
7
|
+
# Cleans the project
|
|
8
|
+
clean:
|
|
9
|
+
rm -rf coverage doc *.gem dist
|
|
10
|
+
|
|
11
|
+
# Generate a test coverage report
|
|
12
|
+
coverage:
|
|
13
|
+
just test
|
|
14
|
+
|
|
15
|
+
# Generate documentation for the library
|
|
16
|
+
docs:
|
|
17
|
+
bundle exec rdoc lib -o docs --title "EasyPost Ruby Docs"
|
|
18
|
+
|
|
19
|
+
# Import the style guides (Unix only)
|
|
20
|
+
install-styleguide: init-examples-submodule
|
|
21
|
+
sh examples/symlink_directory_files.sh examples/style_guides/ruby .
|
|
22
|
+
|
|
23
|
+
# Initialize the examples submodule
|
|
24
|
+
init-examples-submodule:
|
|
25
|
+
git submodule init
|
|
26
|
+
git submodule update
|
|
27
|
+
|
|
28
|
+
# Install globally from source
|
|
29
|
+
install: init-examples-submodule
|
|
30
|
+
bundle install
|
|
31
|
+
|
|
32
|
+
# Lint the project
|
|
33
|
+
lint: rubocop scan
|
|
34
|
+
|
|
35
|
+
# Fix Rubocop errors
|
|
36
|
+
lint-fix: rubocop-fix
|
|
37
|
+
|
|
38
|
+
# Publishes the built gem to Rubygems
|
|
39
|
+
publish:
|
|
40
|
+
gem push dist/*.gem
|
|
41
|
+
|
|
42
|
+
# Cuts a release for the project on GitHub (requires GitHub CLI)
|
|
43
|
+
# tag = The associated tag title of the release
|
|
44
|
+
# target = Target branch or full commit SHA
|
|
45
|
+
release tag target:
|
|
46
|
+
gh release create {{tag}} dist/* --target {{target}}
|
|
47
|
+
|
|
48
|
+
# Lints the project with rubocop
|
|
49
|
+
rubocop:
|
|
50
|
+
bundle exec rubocop
|
|
51
|
+
|
|
52
|
+
# Fix rubocop errors
|
|
53
|
+
rubocop-fix:
|
|
54
|
+
bundle exec rubocop -a
|
|
55
|
+
|
|
56
|
+
# Runs security analysis on the project with Brakeman
|
|
57
|
+
scan:
|
|
58
|
+
bundle exec brakeman lib --force
|
|
59
|
+
|
|
60
|
+
# Test the project (and ignore warnings for test output)
|
|
61
|
+
test:
|
|
62
|
+
bundle exec rspec
|
|
63
|
+
|
|
64
|
+
# Updates dependencies
|
|
65
|
+
update: update-examples-submodule
|
|
66
|
+
|
|
67
|
+
# Update the examples submodule
|
|
68
|
+
update-examples-submodule:
|
|
69
|
+
git submodule init
|
|
70
|
+
git submodule update --remote
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
class EasyPost::Services::ApiKey < EasyPost::Services::Service
|
|
4
|
+
MODEL_CLASS = EasyPost::Models::ApiKey # :nodoc:
|
|
5
|
+
|
|
4
6
|
# Retrieve a list of all ApiKey objects.
|
|
5
7
|
def all
|
|
6
8
|
response = @client.make_request(:get, 'api_keys')
|
|
7
9
|
|
|
8
|
-
EasyPost::InternalUtilities::Json.convert_json_to_object(response,
|
|
10
|
+
EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS)
|
|
9
11
|
end
|
|
10
12
|
|
|
11
13
|
# Retrieve a list of ApiKey objects (works for the authenticated user or a child user).
|
|
@@ -26,4 +28,33 @@ class EasyPost::Services::ApiKey < EasyPost::Services::Service
|
|
|
26
28
|
|
|
27
29
|
raise EasyPost::Errors::FilteringError.new(EasyPost::Constants::NO_USER_FOUND)
|
|
28
30
|
end
|
|
31
|
+
|
|
32
|
+
# Create an API key for a child or referral customer user
|
|
33
|
+
def create(mode)
|
|
34
|
+
response = @client.make_request(:post, 'api_keys', { mode: mode })
|
|
35
|
+
|
|
36
|
+
EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Delete an API key for a child or referral customer user
|
|
40
|
+
def delete(id)
|
|
41
|
+
@client.make_request(:delete, "api_keys/#{id}")
|
|
42
|
+
|
|
43
|
+
# Return true if succeeds, an error will be thrown if it fails
|
|
44
|
+
true
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Enable an API key for a child or referral customer user
|
|
48
|
+
def enable(id)
|
|
49
|
+
response = @client.make_request(:post, "api_keys/#{id}/enable")
|
|
50
|
+
|
|
51
|
+
EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Disable an API key for a child or referral customer user
|
|
55
|
+
def disable(id)
|
|
56
|
+
response = @client.make_request(:post, "api_keys/#{id}/disable")
|
|
57
|
+
|
|
58
|
+
EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS)
|
|
59
|
+
end
|
|
29
60
|
end
|
|
@@ -46,4 +46,12 @@ class EasyPost::Services::Tracker < EasyPost::Services::Service
|
|
|
46
46
|
|
|
47
47
|
all(params)
|
|
48
48
|
end
|
|
49
|
+
|
|
50
|
+
# Delete a Tracker.
|
|
51
|
+
def delete(id)
|
|
52
|
+
@client.make_request(:delete, "trackers/#{id}")
|
|
53
|
+
|
|
54
|
+
# Return true if succeeds, an error will be thrown if it fails
|
|
55
|
+
true
|
|
56
|
+
end
|
|
49
57
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: easypost
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 7.
|
|
4
|
+
version: 7.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- EasyPost Developers
|
|
@@ -9,6 +9,20 @@ bindir: bin
|
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: base64
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - "~>"
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '0.3'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - "~>"
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '0.3'
|
|
12
26
|
- !ruby/object:Gem::Dependency
|
|
13
27
|
name: abbrev
|
|
14
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -211,14 +225,14 @@ dependencies:
|
|
|
211
225
|
requirements:
|
|
212
226
|
- - "~>"
|
|
213
227
|
- !ruby/object:Gem::Version
|
|
214
|
-
version: '6.
|
|
228
|
+
version: '6.4'
|
|
215
229
|
type: :development
|
|
216
230
|
prerelease: false
|
|
217
231
|
version_requirements: !ruby/object:Gem::Requirement
|
|
218
232
|
requirements:
|
|
219
233
|
- - "~>"
|
|
220
234
|
- !ruby/object:Gem::Version
|
|
221
|
-
version: '6.
|
|
235
|
+
version: '6.4'
|
|
222
236
|
- !ruby/object:Gem::Dependency
|
|
223
237
|
name: webmock
|
|
224
238
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -251,11 +265,11 @@ files:
|
|
|
251
265
|
- CHANGELOG.md
|
|
252
266
|
- Gemfile
|
|
253
267
|
- LICENSE
|
|
254
|
-
- Makefile
|
|
255
268
|
- README.md
|
|
256
269
|
- UPGRADE_GUIDE.md
|
|
257
270
|
- VERSION
|
|
258
271
|
- easypost.gemspec
|
|
272
|
+
- justfile
|
|
259
273
|
- lib/easypost.rb
|
|
260
274
|
- lib/easypost/client.rb
|
|
261
275
|
- lib/easypost/connection.rb
|
data/Makefile
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
## help - Display help about make targets for this Makefile
|
|
2
|
-
help:
|
|
3
|
-
@cat Makefile | grep '^## ' --color=never | cut -c4- | sed -e "`printf 's/ - /\t- /;'`" | column -s "`printf '\t'`" -t
|
|
4
|
-
|
|
5
|
-
## build - Builds the project
|
|
6
|
-
build:
|
|
7
|
-
gem build easypost.gemspec --strict
|
|
8
|
-
mkdir -p dist
|
|
9
|
-
mv *.gem dist/
|
|
10
|
-
|
|
11
|
-
## clean - Cleans the project
|
|
12
|
-
clean:
|
|
13
|
-
rm -rf coverage doc *.gem dist
|
|
14
|
-
|
|
15
|
-
## coverage - Generate a test coverage report
|
|
16
|
-
coverage: test
|
|
17
|
-
|
|
18
|
-
## docs - Generate documentation for the library
|
|
19
|
-
docs:
|
|
20
|
-
bundle exec rdoc lib -o docs --title "EasyPost Ruby Docs"
|
|
21
|
-
|
|
22
|
-
## install-styleguide - Import the style guides (Unix only)
|
|
23
|
-
install-styleguide: | init-examples-submodule
|
|
24
|
-
sh examples/symlink_directory_files.sh examples/style_guides/ruby .
|
|
25
|
-
|
|
26
|
-
## init-examples-submodule - Initialize the examples submodule
|
|
27
|
-
init-examples-submodule:
|
|
28
|
-
git submodule init
|
|
29
|
-
git submodule update
|
|
30
|
-
|
|
31
|
-
## install - Install globally from source
|
|
32
|
-
install: | init-examples-submodule
|
|
33
|
-
bundle install
|
|
34
|
-
|
|
35
|
-
## lint - Lint the project
|
|
36
|
-
lint: rubocop scan
|
|
37
|
-
|
|
38
|
-
## lint-fix - Fix Rubocop errors
|
|
39
|
-
lint-fix: rubocop-fix
|
|
40
|
-
|
|
41
|
-
## publish - Publishes the built gem to Rubygems
|
|
42
|
-
publish:
|
|
43
|
-
gem push dist/*.gem
|
|
44
|
-
|
|
45
|
-
## release - Cuts a release for the project on GitHub (requires GitHub CLI)
|
|
46
|
-
# tag = The associated tag title of the release
|
|
47
|
-
# target = Target branch or full commit SHA
|
|
48
|
-
release:
|
|
49
|
-
gh release create ${tag} dist/* --target ${target}
|
|
50
|
-
|
|
51
|
-
## rubocop - lints the project with rubocop
|
|
52
|
-
rubocop:
|
|
53
|
-
bundle exec rubocop
|
|
54
|
-
|
|
55
|
-
## rubocop-fix - fix rubocop errors
|
|
56
|
-
rubocop-fix:
|
|
57
|
-
bundle exec rubocop -a
|
|
58
|
-
|
|
59
|
-
## scan - Runs security analysis on the project with Brakeman
|
|
60
|
-
scan:
|
|
61
|
-
bundle exec brakeman lib --force
|
|
62
|
-
|
|
63
|
-
## test - Test the project (and ignore warnings for test output)
|
|
64
|
-
test:
|
|
65
|
-
bundle exec rspec
|
|
66
|
-
|
|
67
|
-
## update - Updates dependencies
|
|
68
|
-
update: | update-examples-submodule
|
|
69
|
-
|
|
70
|
-
## update-examples-submodule - Update the examples submodule
|
|
71
|
-
update-examples-submodule:
|
|
72
|
-
git submodule init
|
|
73
|
-
git submodule update --remote
|
|
74
|
-
|
|
75
|
-
.PHONY: help build clean coverage docs install install-styleguide lint lint-fix publish release rubocop rubocop-fix scan test update update-examples-submodule
|