Skip to content

Commit

Permalink
Checking in changes prior to tagging of version 0.06.
Browse files Browse the repository at this point in the history
Changelog diff is:

diff --git a/Changes b/Changes
index f675529..0ff2715 100644
--- a/Changes
+++ b/Changes
@@ -2,6 +2,11 @@ Revision history for Perl extension At.pm
 
 {{$NEXT}}
 
+0.06 2024-01-19T02:20:52Z
+
+    - Update according to lexicon changes in bluesky-social/atproto@e43396a
+       - phone verification support on account creation
+
 0.05 2024-01-09T04:01:09Z
 
     - Update according to lexicon changes in bluesky-social/atproto#1970
  • Loading branch information
sanko committed Jan 19, 2024
1 parent f6c2990 commit 79b1936
Show file tree
Hide file tree
Showing 19 changed files with 84 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ eg/notifications.pl
eg/podfix.pl
eg/subscription.pl
eg/temp.pm

eg/*.pl
5 changes: 5 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ Revision history for Perl extension At.pm

{{$NEXT}}

0.06 2024-01-19T02:20:52Z

- Update according to lexicon changes in bluesky-social/atproto@e43396a
- phone verification support on account creation

0.05 2024-01-09T04:01:09Z

- Update according to lexicon changes in bluesky-social/atproto#1970
Expand Down
2 changes: 1 addition & 1 deletion META.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"web" : "https://github.com/sanko/At.pm"
}
},
"version" : "0.05",
"version" : "0.06",
"x_serialization_backend" : "JSON::PP version 4.16",
"x_static_install" : 1
}
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -832,8 +832,8 @@ $at->server_describeServer( );

This method does not require an authenticated session.

Returns a boolean value indicating whether an invite code is required, a list of available user domains, and links to
the TOS and privacy policy.
Returns a list of available user domains and, optionally, boolean values indicating whether an invite code and/or phone
verification are required, and links to the TOS and privacy policy.

## `server_listAppPasswords( )`

Expand Down Expand Up @@ -1356,6 +1356,22 @@ Expected parameters include:

The DID of the repo.

## `temp_requestPhoneVerification( ... )`

```
$at->temp_requestPhoneVerification( '2125551000' );
```

Request a verification code to be sent to the supplied phone number.

Expected parameters include:

- `phoneNumber` - required

Phone number

Returns a true value on success.

# See Also

[https://atproto.com/](https://atproto.com/)
Expand Down
53 changes: 41 additions & 12 deletions lib/At.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package At 0.05 {
package At 0.06 {
use v5.38;
no warnings 'experimental::class', 'experimental::builtin', 'experimental::for_list'; # Be quiet.
use feature 'class';
Expand Down Expand Up @@ -698,21 +698,26 @@ package At 0.05 {

method server_createAccount (
$handle,
$email //= (),
$password //= (),
$inviteCode //= (),
$did //= (),
$recoveryKey //= (),
$plcOP //= ()
$email //= (),
$password //= (),
$inviteCode //= (),
$verificationCode //= (),
$verificationPhone //= (),
$did //= (),
$recoveryKey //= (),
$plcOP //= ()
) {
Carp::cluck 'likely do not want an authenticated client' if defined $self->http->session;
my $res = $self->http->post(
sprintf( '%s/xrpc/%s', $self->host(), 'com.atproto.server.createAccount' ),
{ content => +{
handle => $handle,
defined $email ? ( email => $email ) : (), defined $did ? ( did => $did ) : (),
defined $inviteCode ? ( inviteCode => $inviteCode ) : (), defined $password ? ( password => $password ) : (),
defined $recoveryKey ? ( recoveryKey => $recoveryKey ) : (), defined $plcOP ? ( plcOP => $plcOP ) : ()
defined $email ? ( email => $email ) : (), defined $did ? ( did => $did ) : (),
defined $inviteCode ? ( inviteCode => $inviteCode ) : (),
defined $verificationCode ? ( verificationCode => $verificationCode ) : (),
defined $verificationPhone ? ( verificationPhone => $verificationPhone ) : (),
defined $password ? ( password => $password ) : (), defined $recoveryKey ? ( recoveryKey => $recoveryKey ) : (),
defined $plcOP ? ( plcOP => $plcOP ) : ()
}
}
);
Expand Down Expand Up @@ -862,6 +867,12 @@ package At 0.05 {
my $res = $self->http->post( sprintf( '%s/xrpc/%s', $self->host, 'com.atproto.temp.importRepo' ), { content => +{ did => $did } } );
$res->{success};
}

method temp_requestPhoneVerification ($phoneNumber) {
my $res = $self->http->post( sprintf( '%s/xrpc/%s', $self->host, 'com.atproto.temp.requestPhoneVerification' ),
{ content => +{ phoneNumber => $phoneNumber } } );
$res->{success};
}
}

class At::Protocol::DID { # https://atproto.com/specs/did
Expand Down Expand Up @@ -2017,8 +2028,8 @@ Get a document describing the service's accounts configuration.
This method does not require an authenticated session.
Returns a boolean value indicating whether an invite code is required, a list of available user domains, and links to
the TOS and privacy policy.
Returns a list of available user domains and, optionally, boolean values indicating whether an invite code and/or phone
verification are required, and links to the TOS and privacy policy.
=head2 C<server_listAppPasswords( )>
Expand Down Expand Up @@ -2602,6 +2613,24 @@ The DID of the repo.
=back
=head2 C<temp_requestPhoneVerification( ... )>
$at->temp_requestPhoneVerification( '2125551000' );
Request a verification code to be sent to the supplied phone number.
Expected parameters include:
=over
=item C<phoneNumber> - required
Phone number
=back
Returns a true value on success.
=begin todo
=head1 Services
Expand Down
2 changes: 1 addition & 1 deletion lib/At/Lexicon/app/bsky/actor.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package At::Lexicon::app::bsky::actor 0.05 {
package At::Lexicon::app::bsky::actor 0.06 {
use v5.38;
no warnings 'experimental::class', 'experimental::builtin'; # Be quiet.
use feature 'class';
Expand Down
2 changes: 1 addition & 1 deletion lib/At/Lexicon/app/bsky/embed.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package At::Lexicon::app::bsky::actor 0.05 {
package At::Lexicon::app::bsky::actor 0.06 {
use v5.38;
no warnings 'experimental::class', 'experimental::builtin'; # Be quiet.
use feature 'class';
Expand Down
2 changes: 1 addition & 1 deletion lib/At/Lexicon/app/bsky/feed.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package At::Lexicon::app::bsky::feed 0.05 {
package At::Lexicon::app::bsky::feed 0.06 {
use v5.38;
no warnings 'experimental::class', 'experimental::builtin'; # Be quiet.
use feature 'class';
Expand Down
2 changes: 1 addition & 1 deletion lib/At/Lexicon/app/bsky/graph.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package At::Lexicon::app::bsky::graph 0.05 {
package At::Lexicon::app::bsky::graph 0.06 {
use v5.38;
no warnings 'experimental::class', 'experimental::builtin'; # Be quiet.
use feature 'class';
Expand Down
2 changes: 1 addition & 1 deletion lib/At/Lexicon/app/bsky/notification.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package At::Lexicon::app::bsky::notification 0.05 {
package At::Lexicon::app::bsky::notification 0.06 {
use v5.38;
no warnings 'experimental::class', 'experimental::builtin'; # Be quiet.
use feature 'class';
Expand Down
9 changes: 5 additions & 4 deletions lib/At/Lexicon/app/bsky/richtext.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package At::Lexicon::app::bsky::richtext 0.05 {
package At::Lexicon::app::bsky::richtext 0.06 {
use v5.38;
no warnings 'experimental::class', 'experimental::builtin'; # Be quiet.
use feature 'class';
Expand Down Expand Up @@ -73,8 +73,9 @@ package At::Lexicon::app::bsky::richtext 0.05 {

# A text segment. Start is inclusive, end is exclusive. Indices are for utf8-encoded strings.
class At::Lexicon::app::bsky::richtext::facet::byteSlice {
field $byteEnd : param; # int, required, minimum: 0
field $byteStart : param; # int, required, minimum: 0
field $type : param($type) //= (); # record field
field $byteEnd : param; # int, required, minimum: 0
field $byteStart : param; # int, required, minimum: 0
ADJUST {
Carp::confess 'byteEnd must be greater than 0' if $byteEnd < 0;
Carp::confess 'byteStart must be greater than 0' if $byteStart < 0;
Expand All @@ -85,7 +86,7 @@ package At::Lexicon::app::bsky::richtext 0.05 {
method byteStart {$byteStart}

method _raw() {
+{ byteEnd => $byteEnd, byteStart => $byteStart };
+{ defined $type ? ( '$type' => $type ) : (), byteEnd => $byteEnd, byteStart => $byteStart };
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion lib/At/Lexicon/app/bsky/unspecced.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package At::Lexicon::app::bsky::unspecced 0.05 {
package At::Lexicon::app::bsky::unspecced 0.06 {
use v5.38;
no warnings 'experimental::class', 'experimental::builtin'; # Be quiet.
use feature 'class';
Expand Down
2 changes: 1 addition & 1 deletion lib/At/Lexicon/com/atproto/admin.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package At::Lexicon::com::atproto::admin 0.05 {
package At::Lexicon::com::atproto::admin 0.06 {

#~ https://github.com/bluesky-social/atproto/blob/main/lexicons/com/atproto/admin/defs.json
use v5.38;
Expand Down
2 changes: 1 addition & 1 deletion lib/At/Lexicon/com/atproto/label.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package At::Lexicon::com::atproto::label 0.05 {
package At::Lexicon::com::atproto::label 0.06 {
use v5.38;
no warnings 'experimental::class', 'experimental::builtin'; # Be quiet.
use feature 'class';
Expand Down
2 changes: 1 addition & 1 deletion lib/At/Lexicon/com/atproto/moderation.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package At::Lexicon::com::atproto::moderation 0.05 {
package At::Lexicon::com::atproto::moderation 0.06 {

#~ https://github.com/bluesky-social/atproto/blob/main/lexicons/com/atproto/moderation/defs.json
use v5.38;
Expand Down
2 changes: 1 addition & 1 deletion lib/At/Lexicon/com/atproto/repo.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package At::Lexicon::com::atproto::repo 0.05 {
package At::Lexicon::com::atproto::repo 0.06 {
use v5.38;
no warnings 'experimental::class', 'experimental::builtin'; # Be quiet.
use feature 'class';
Expand Down
2 changes: 1 addition & 1 deletion lib/At/Lexicon/com/atproto/server.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package At::Lexicon::com::atproto::server 0.05 {
package At::Lexicon::com::atproto::server 0.06 {
use v5.38;
no warnings 'experimental::class', 'experimental::builtin'; # Be quiet.
use feature 'class';
Expand Down
2 changes: 1 addition & 1 deletion lib/At/Lexicon/com/atproto/sync.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package At::Lexicon::com::atproto::sync 0.05 {
package At::Lexicon::com::atproto::sync 0.06 {
use v5.38;
use lib '../../../../../lib';
no warnings 'experimental::class', 'experimental::builtin', 'experimental::try'; # Be quiet.
Expand Down
2 changes: 1 addition & 1 deletion t/28_com_atproto_temp.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ subtest 'live' => sub {
my $at = At->new( host => 'bsky.social' );

# Do not run these tests; they might not be supported upstream...
can_ok $at, $_ for qw[temp_fetchLables temp_pushBlob temp_transferAccount temp_importRepo];
can_ok $at, $_ for qw[temp_fetchLables temp_pushBlob temp_transferAccount temp_importRepo temp_requestPhoneVerification];
};
#
done_testing;

0 comments on commit 79b1936

Please sign in to comment.