Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.2.1 #9

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Build.PL
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ my $builder = Module::Build->new(
module_name => 'Net::Upwork::API',
license => 'apache',
dist_author => 'Maksym Novozhylov <mnovozhilov@upwork.com>',
dist_version => '2.2.0',
dist_version => '2.2.1',
dist_abstract => 'Perl bindings for Upwork API (OAuth2)',
build_requires => {
'Test::More' => '0.66',
Expand Down
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2.2.1
* Fix auto-refreshing issue. Introduce new parameter for set_access_token_session(). See example script.

## 2.2.0
* Add support of Client Credentials Grant

Expand Down
46 changes: 46 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,52 @@
Build.PL
CHANGES.md
example/example.pl
html/_blkbluw.css
html/_blkcynw.css
html/_blkgrng.css
html/_blkmagw.css
html/_grygrnk.css
html/_grygrnw.css
html/_podly.js
html/_whtgrng.css
html/_whtnavk.css
html/_whtprpk.css
html/index.html
html/Net/Upwork/API.html
html/Net/Upwork/API/Client.html
html/Net/Upwork/API/Config.html
html/Net/Upwork/API/Routers/Activities/Engagement.html
html/Net/Upwork/API/Routers/Activities/Team.html
html/Net/Upwork/API/Routers/Auth.html
html/Net/Upwork/API/Routers/Freelancers/Profile.html
html/Net/Upwork/API/Routers/Freelancers/Search.html
html/Net/Upwork/API/Routers/Graphql.html
html/Net/Upwork/API/Routers/Hr/Clients/Applications.html
html/Net/Upwork/API/Routers/Hr/Clients/Offers.html
html/Net/Upwork/API/Routers/Hr/Contracts.html
html/Net/Upwork/API/Routers/Hr/Engagements.html
html/Net/Upwork/API/Routers/Hr/Freelancers/Applications.html
html/Net/Upwork/API/Routers/Hr/Freelancers/Offers.html
html/Net/Upwork/API/Routers/Hr/Interviews.html
html/Net/Upwork/API/Routers/Hr/Jobs.html
html/Net/Upwork/API/Routers/Hr/Milestones.html
html/Net/Upwork/API/Routers/Hr/Roles.html
html/Net/Upwork/API/Routers/Hr/Submissions.html
html/Net/Upwork/API/Routers/Jobs/Profile.html
html/Net/Upwork/API/Routers/Jobs/Search.html
html/Net/Upwork/API/Routers/Messages.html
html/Net/Upwork/API/Routers/Metadata.html
html/Net/Upwork/API/Routers/Organization/Companies.html
html/Net/Upwork/API/Routers/Organization/Teams.html
html/Net/Upwork/API/Routers/Organization/Users.html
html/Net/Upwork/API/Routers/Payments.html
html/Net/Upwork/API/Routers/Reports/Finance/Accounts.html
html/Net/Upwork/API/Routers/Reports/Finance/Billings.html
html/Net/Upwork/API/Routers/Reports/Finance/Earnings.html
html/Net/Upwork/API/Routers/Reports/Time.html
html/Net/Upwork/API/Routers/Snapshot.html
html/Net/Upwork/API/Routers/Workdays.html
html/Net/Upwork/API/Routers/Workdiary.html
lib/Net/Upwork/API.pm
lib/Net/Upwork/API/Client.pm
lib/Net/Upwork/API/Config.pm
Expand Down
7 changes: 5 additions & 2 deletions lib/Net/Upwork/API.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use warnings;
use Net::Upwork::API::Config;
use Net::Upwork::API::Client;

our $VERSION = '2.2.0';
our $VERSION = '2.2.1';

use constant TOKEN_TYPE_BEARER => 'Bearer';

Expand Down Expand Up @@ -170,10 +170,11 @@ B<Return value>

sub set_access_token_session() {
my $self = shift;
my $auto_refresh = shift;

$self->{client}{access_token_session} = Net::OAuth2::AccessToken->new(
profile => $self->{client}->get_oauth_client,
auto_refresh => 0,
auto_refresh => $auto_refresh ? 1 : 0,
(
access_token => $self->{config}{access_token},
refresh_token => $self->{config}{refresh_token},
Expand All @@ -187,6 +188,8 @@ sub set_access_token_session() {
if ($self->{config}{expires_at} < time()) {
$self->{client}{access_token_session}->refresh();
}

return $self->{client}{access_token_session};
}

=item client()
Expand Down
Loading