App-reposdb

 view release on metacpan or  search on metacpan

script/reposdb-inline  view on Meta::CPAN

             ; if ($_sahv_err) { return [400, "Argument validation failed: $_sahv_err"] }
        } # if date arg exists
        if (exists $args->{"pull_time"}) {
            $_sahv_dpath = [];
            # skip if undef
            (!defined($args->{"pull_time"}) ? 1 : 
            
            (# check type 'bool'
            ((!ref($args->{"pull_time"})) ? 1 : (($_sahv_err //= "Not of type boolean value"),0))
            
            &&
            
            (# clause: is
            (($args->{"pull_time"} ? 1:0) == (1 ? 1:0) ? 1 : (($_sahv_err //= "Must have the value 1"),0)))))
             ; if ($_sahv_err) { return [400, "Argument validation failed: $_sahv_err"] }
        } # if date arg exists
        if (exists $args->{"repo"}) {
            $_sahv_dpath = [];
            # req #0
            ((defined($args->{"repo"})) ? 1 : (($_sahv_err //= "Required but not specified"),0))
            
            &&
            
            # check type 'str'
            ((!ref($args->{"repo"})) ? 1 : (($_sahv_err //= "Not of type text"),0))
             ; if ($_sahv_err) { return [400, "Argument validation failed: $_sahv_err"] }
        } # if date arg exists
        if (exists $args->{"reposdb_path"}) {
            $_sahv_dpath = [];
            # req #0
            ((defined($args->{"reposdb_path"})) ? 1 : (($_sahv_err //= "Required but not specified"),0))
            
            &&
            
            # check type 'str'
            ((!ref($args->{"reposdb_path"})) ? 1 : (($_sahv_err //= "Not of type text"),0))
             ; if ($_sahv_err) { return [400, "Argument validation failed: $_sahv_err"] }
        } # if date arg exists
        if (exists $args->{"status_time"}) {
            $_sahv_dpath = [];
            # skip if undef
            (!defined($args->{"status_time"}) ? 1 : 
            
            (# check type 'bool'
            ((!ref($args->{"status_time"})) ? 1 : (($_sahv_err //= "Not of type boolean value"),0))
            
            &&
            
            (# clause: is
            (($args->{"status_time"} ? 1:0) == (1 ? 1:0) ? 1 : (($_sahv_err //= "Must have the value 1"),0)))))
             ; if ($_sahv_err) { return [400, "Argument validation failed: $_sahv_err"] }
        } # if date arg exists
        if (exists $args->{"to"}) {
            $_sahv_dpath = [];
            # req #0
            ((defined($args->{"to"})) ? 1 : (($_sahv_err //= "Required but not specified"),0))
            
            &&
            
            # coerce rule(s): From_float::epoch, From_obj::datetime, From_obj::time_moment, From_str::iso8601 # coerce to: float(epoch)
            (($args->{"to"} = (!ref($args->{"to"}) && $args->{"to"} =~ /\A[0-9]{8,10}(?:.[0-9]+)?\z/ && $args->{"to"} >= 10**8 && $args->{"to"} <= 2**31) ? [undef,$args->{"to"}] : ((Scalar::Util::blessed($args->{"to"}) && $args->{"to"}->isa('DateTime...
            
            &&
            
            # check type 'date'
            ((!ref($args->{"to"}) && $args->{"to"} =~ /\A[0-9]+\z/) ? 1 : (($_sahv_err //= "Not of type date"),0))
             ; if ($_sahv_err) { return [400, "Argument validation failed: $_sahv_err"] }
        } # if date arg exists

        # check required args
        return [400, "Missing required value for argument: repo"] if exists($args->{"repo"}) && !defined($args->{"repo"});
        return [400, "Missing required argument: reposdb_path"] unless exists $args->{"reposdb_path"};
        return [400, "Missing required value for argument: reposdb_path"] if exists($args->{"reposdb_path"}) && !defined($args->{"reposdb_path"});
        return [400, "Missing required value for argument: to"] if exists($args->{"to"}) && !defined($args->{"to"});
        _pci_err([500, "Extraneous command-line argument(s): ".join(", ", @check_argv)]) if @check_argv;
        [200];
    } else { _pci_err([500, "Unknown subcommand1: $sc_name"]); }
}
1;

# END Local::_pci_check_args

# BEGIN Local::_pci_clean_json
sub _pci_clean_json { require Clone::PP; require Scalar::Util;  use feature 'state'; state $cleanser = sub {
my $data = shift;
state %refs;
state $ctr_circ;
state $process_array;
state $process_hash;
if (!$process_array) { $process_array = sub { my $a = shift; for my $e (@$a) { my $ref=ref($e);
    if ($ref && $refs{ $e }++) { if (++$ctr_circ <= 1) { $e = Clone::PP::clone($e); redo } else { $e = 'CIRCULAR'; $ref = '' } }
    elsif ($ref eq 'Cpanel::JSON::XS::Boolean') { $e = $e ? 1:0; $ref = '' }
    elsif ($ref eq 'DateTime') { $e = $e->epoch; $ref = ref($e) }
    elsif ($ref eq 'JSON::PP::Boolean') { $e = $e ? 1:0; $ref = '' }
    elsif ($ref eq 'JSON::XS::Boolean') { $e = $e ? 1:0; $ref = '' }
    elsif ($ref eq 'Math::BigInt') { $e = $e->bstr; $ref = ref($e) }
    elsif ($ref eq 'Regexp') { $e = "$e"; $ref = "" }
    elsif ($ref eq 'SCALAR') { $e = ${ $e }; $ref = ref($e) }
    elsif ($ref eq 'Time::Moment') { $e = $e->epoch; $ref = ref($e) }
    elsif ($ref eq 'version') { $e = "$e"; $ref = "" }
    elsif (Scalar::Util::blessed($e)) { my $reftype = Scalar::Util::reftype($e); $e = $reftype eq "HASH" ? {%{ $e }} : $reftype eq "ARRAY" ? [@{ $e }] : $reftype eq "SCALAR" ? \(my $copy = ${ $e }) : $reftype eq "CODE" ? sub { goto &{ $e } } :(die "C...
    my $reftype=Scalar::Util::reftype($e)//"";
    if ($reftype eq "ARRAY") { $process_array->($e) }
    elsif ($reftype eq "HASH") { $process_hash->($e) }
    elsif ($ref) { $e = $ref; $ref = "" }
} } }
if (!$process_hash) { $process_hash = sub { my $h = shift; for my $k (keys %$h) { my $ref=ref($h->{$k});
    if ($ref && $refs{ $h->{$k} }++) { if (++$ctr_circ <= 1) { $h->{$k} = Clone::PP::clone($h->{$k}); redo } else { $h->{$k} = 'CIRCULAR'; $ref = '' } }
    elsif ($ref eq 'Cpanel::JSON::XS::Boolean') { $h->{$k} = $h->{$k} ? 1:0; $ref = '' }
    elsif ($ref eq 'DateTime') { $h->{$k} = $h->{$k}->epoch; $ref = ref($h->{$k}) }
    elsif ($ref eq 'JSON::PP::Boolean') { $h->{$k} = $h->{$k} ? 1:0; $ref = '' }
    elsif ($ref eq 'JSON::XS::Boolean') { $h->{$k} = $h->{$k} ? 1:0; $ref = '' }
    elsif ($ref eq 'Math::BigInt') { $h->{$k} = $h->{$k}->bstr; $ref = ref($h->{$k}) }
    elsif ($ref eq 'Regexp') { $h->{$k} = "$h->{$k}"; $ref = "" }
    elsif ($ref eq 'SCALAR') { $h->{$k} = ${ $h->{$k} }; $ref = ref($h->{$k}) }
    elsif ($ref eq 'Time::Moment') { $h->{$k} = $h->{$k}->epoch; $ref = ref($h->{$k}) }
    elsif ($ref eq 'version') { $h->{$k} = "$h->{$k}"; $ref = "" }
    elsif (Scalar::Util::blessed($h->{$k})) { my $reftype = Scalar::Util::reftype($h->{$k}); $h->{$k} = $reftype eq "HASH" ? {%{ $h->{$k} }} : $reftype eq "ARRAY" ? [@{ $h->{$k} }] : $reftype eq "SCALAR" ? \(my $copy = ${ $h->{$k} }) : $reftype eq "C...
    my $reftype=Scalar::Util::reftype($h->{$k})//"";
    if ($reftype eq "ARRAY") { $process_array->($h->{$k}) }
    elsif ($reftype eq "HASH") { $process_hash->($h->{$k}) }
    elsif ($ref) { $h->{$k} = $ref; $ref = "" }
} } }
%refs = (); $ctr_circ=0;
for ($data) { my $ref=ref($_);
    if ($ref && $refs{ $_ }++) { if (++$ctr_circ <= 1) { $_ = Clone::PP::clone($_); redo } else { $_ = 'CIRCULAR'; $ref = '' } }
    elsif ($ref eq 'Cpanel::JSON::XS::Boolean') { $_ = $_ ? 1:0; $ref = '' }
    elsif ($ref eq 'DateTime') { $_ = $_->epoch; $ref = ref($_) }
    elsif ($ref eq 'JSON::PP::Boolean') { $_ = $_ ? 1:0; $ref = '' }
    elsif ($ref eq 'JSON::XS::Boolean') { $_ = $_ ? 1:0; $ref = '' }
    elsif ($ref eq 'Math::BigInt') { $_ = $_->bstr; $ref = ref($_) }
    elsif ($ref eq 'Regexp') { $_ = "$_"; $ref = "" }
    elsif ($ref eq 'SCALAR') { $_ = ${ $_ }; $ref = ref($_) }
    elsif ($ref eq 'Time::Moment') { $_ = $_->epoch; $ref = ref($_) }
    elsif ($ref eq 'version') { $_ = "$_"; $ref = "" }
    elsif (Scalar::Util::blessed($_)) { my $reftype = Scalar::Util::reftype($_); $_ = $reftype eq "HASH" ? {%{ $_ }} : $reftype eq "ARRAY" ? [@{ $_ }] : $reftype eq "SCALAR" ? \(my $copy = ${ $_ }) : $reftype eq "CODE" ? sub { goto &{ $_ } } :(die "C...
    my $reftype=Scalar::Util::reftype($_)//"";
    if ($reftype eq "ARRAY") { $process_array->($_) }
    elsif ($reftype eq "HASH") { $process_hash->($_) }
    elsif ($ref) { $_ = $ref; $ref = "" }
}
$data
}
;; $cleanser->(shift) }
1;

# END Local::_pci_clean_json

### begin code_after_end
### end code_after_end

__END__

=pod

=encoding UTF-8

=head1 NAME

reposdb-inline

=head1 VERSION

This document describes version 0.007 of main (from Perl distribution App-reposdb), released on 2020-10-10.

=head1 SYNOPSIS

Usage:

 % reposdb-inline ls [--config-path=path+] [--config-profile=profile]
     [--detail] [--format=name] [--has-tag=s+] [--has-tags-json=s] [--json]
     [-l] [--lacks-tag=s+] [--lacks-tags-json=s] [--(no)naked-res]
     [--no-config] [--no-detail] [--no-env] [--nodetail]
     [--page-result[=program]] [--reposdb-path=s] [--sort=s+]
     [--sorts-json=s] [--view-result[=program]]
 % reposdb-inline remove-all-tags [--config-path=path+]
     [--config-profile=profile] [--format=name] [--json] [--(no)naked-res]
     [--no-config] [--no-env] [--page-result[=program]] [--reposdb-path=s]
     [--view-result[=program]] [repo]
 % reposdb-inline remove-tag [--config-path=path+]
     [--config-profile=profile] [--format=name] [--json] [--(no)naked-res]
     [--no-config] [--no-env] [--page-result[=program]] [--reposdb-path=s]
     [--view-result[=program]] [repo] <tags> ...
 % reposdb-inline touch [--commit-time] [--config-path=path+]
     [--config-profile=profile] [--format=name] [--json] [--(no)naked-res]
     [--no-config] [--no-env] [--page-result[=program]] [--pull-time]
     [--reposdb-path=s] [--status-time] [--to=s] [--view-result[=program]]
     [repo]



( run in 1.056 second using v1.01-cache-2.11-cpan-39bf76dae61 )