:Tee;
use IO::Pipe;
use Time::HiRes;
use HTTP::Request;
use HTTP::Response;
use System::Info;
use JSON;
$Carp::Internal{__PACKAGE__} = 1;
our $VERSION = '0.05';
my %request_headers;
our $cgi = CGI-
TTP::Request->new( POST => $uri );
$sb_request->content_type('application/json');
$sb_request->content( encode_json($slapbird_hash) );
$sb_request->header( 'x-slapbird-apm' => $key );
--minimum Report based on minimum (default recommended)";
say " -j F --json=F Use downloaded JSON instead of fetching";
say " -p --perl Report CVE's on required pe
version";
say " -v[#] --verbose[=#] Set verbosity level";
say " -J F --json-out=F Output in JSON file F (- = STDOUT)";
say "";
say "For CVE's in the perl core, please use --p
say "Documentation should still be written";
exit $err;
} # usage
use Test::CVE;
use JSON::MaybeXS;
use Module::CoreList;
use Cwd qw( getcwd abs_path);
use Getopt::Long qw(:confi
warnings;
use Moose; # Catalyst::View;
extends 'Catalyst::View::TT';
our $VERSION = '0.04';
use JSON;
around 'render' => sub {
my ($meth, $orig, $c, $template, $args) = (@_, $_[2]->stash());
my (
($c->stash->{JSON}) {
my $body = $self->build_json($c, $c->stash->{JSON});
$body->{html} = $output;
$output = JSON->new->encode($body);
$c->response->content_type("application/json; charset=UT
ault);
}
}
$c->response->body($output);
return 1;
}
sub build_json {
my ($self, $c, $json) = @_;
return ref $json ? $json : {};
}
1;
__END__
=head1 NAME
Catalyst::View::TT::Progressive -
has public_url => "https://members-api.parliament.uk/swagger/v1/swagger.json";
has private_url => "swagger/members-api.json";
has base_url => 'https://members-api.parliament.uk/';
1;
__END__
=h
'precache_endpoint',
field => 'Precache Endpoint',
info => 'An API endpoint that returns an JSON array containing a list of resources/endpoints to add to the precache.',
required => 1,
},
le q|PWA Manifest|;
say q|The web app manifest provides information about a web application in a JSON text file,|
. q| necessary for the web app to be downloaded and be presented to the user similar
Spec::Functions qw/catfile rel2abs/;
use Getopt::Long 2.36 'GetOptionsFromArray';
use JSON::MaybeXS qw/decode_json/;
use Module::Runtime 'require_module';
use Text::Template;
use App::ModuleBuildTiny
fill_in($template, \%opts));
}
sub read_json {
my $filename = shift;
-f $filename or return;
return decode_json(read_binary($filename));
}
sub write_json {
my ($filename, $content) = @_;
my $d
ame);
mkdir $dirname if not -d $dirname;
my $json = JSON::MaybeXS->new->utf8->pretty->canonical->encode($content);
return write_binary($filename, $json);
}
sub bump_versions {
my (%opts) = @_;
r
;
use Cpanel::JSON::XS;
use File::Slurper qw (read_text);
use File::Spec;
use Readonly;
use Data::Walk;
use Try::Tiny;
our $VERSION = '0.11';
our $override;
my $JSON_OBJ = Cpanel::JSON::XS->new()->u
fixtures);
$self->_set_mock_dbh($fixtures);
} elsif (-e $self->{fixture_file}) {
my $data = $JSON_OBJ->decode(read_text($self->{fixture_file}));
$self->_process_mock_data($data);
$self->_set_
($directory . $FIXTURE_DIR);
my $default_fixture_file = $directory . $FIXTURE_DIR . "$test_file.json";
$self->{fixture_file} = $default_fixture_file;
}
return $self;
}
sub _validate_args {
my
ict;
use warnings;
use Data::Dumper;
use JSON::MaybeXS;
use Carp qw( croak );
use DDP;
use Langertha::Engine::Ollama;
use Langertha::Engine::OpenAI;
my $jsonschema = {
type => 'object',
properti
['time','action'],
additionalProperties => JSON->false,
},
},
},
required => [qw( activities )],
additionalProperties => JSON->false,
};
my $prompt = <<"__EOP__";
I want to i
nai( response_format => {
type => "json_schema",
json_schema => {
name => "training",
schema => $jsonschema,
strict => JSON->true,
},
});
my $structs
.04';
use JSON::Lines;
use JSON;
sub new {
my ($pkg, $args) = @_;
my $self = bless {
scriptures => undef,
scripture => undef,
scripture_file => undef,
index => -1,
jsonl => JSON::Lines->n
ew(),
json => JSON->new->pretty(1)->canonical,
directory => 'directory',
%{ $args || {} },
}, $pkg;
$self->{scriptures} = $self->directory($self->{directory});
$self->scripture($self->{scri
lvage') {
$self->$in();
print qq|Scripture salvaged\n|;
} else {
my $enc = $self->{json}->encode($self->$in());
print $self->{index} . ": " . $enc;
}
} elsif ($in =~ m/scriptur
onse) {
return response ? response.clone() : requestWith === 'XMLHttpRequest' ? new Response(JSON.stringify({
error: "Network issues, try again when you're back online"
})) : htmlRespo
response for the passed request if found then this is returned else
it will fall back to either a JSON response or the Response that is cached via the 'offline_path' param based upon the requestWith h
package Progressive::Web::Application;
use 5.006;
use strict;
use warnings;
use Carp qw//;
use JSON;
use Colouring::In;
use Image::Scale;
use Cwd qw/abs_path/;
our $VERSION = '0.09';
our (%TOOL, %MANI
Colouring::In->new($_[0])->toCSS; },
JSON => JSON->new->utf8->pretty,
to_json => sub { $TOOL{JSON}->encode($_[0]); },
from_json => sub { return $TOOL{JSON}->decode($_[0]); },
make_path => sub
sprintf
q/Required field not passed for icon missing %s for %s/,
$_,
$TOOL{to_json}->($_[0])
);
}
$TOOL{scalar_check}->($_[0]->{$_}, $_);
}
$_[0]->{src} = q|/| .
>parse_characters(1);
$parser->parse_file($filename);
return decode_utf8($content);
}
sub load_jsonyaml {
my $file = shift;
require Parse::CPAN::Meta;
return Parse::CPAN::Meta->load_file($file);
ad_mergedata {
my $mergefile = shift;
if (defined $mergefile and -r $mergefile) {
return load_jsonyaml($mergefile);
}
return;
}
sub distname {
my $extra = shift;
return delete $extra->{name}
%opts) = @_;
my @prereqs;
if (-f 'prereqs.json') {
push @prereqs, load_jsonyaml('prereqs.json');
}
if (-f 'prereqs.yml') {
push @prereqs, load_jsonyaml('prereqs.yml');
}
if (-f 'cpanfile')
,
cpansa => "https://cpan-security.github.io/cpansa-feed/cpansa.json",
cpanfile => "cpanfile",
meta_jsn => "META.json",
meta_yml => "META.yml", # NYI
make_pl => "Makefile.PL
use warnings;
our $VERSION = "0.11";
use version;
use Carp;
use HTTP::Tiny;
use Text::Wrap;
use JSON::MaybeXS;
use Module::CoreList;
use YAML::PP ();
use List::Util qw( first uniq );
use base
;
my %self = @_;
$self{cpansa} ||= "https://cpan-security.github.io/cpansa-feed/cpansa.json";
$self{deps} //= 1;
$self{perl} //= 1;
$self{core} //= 1;
$self{mini
tch(precache_endpoint).then(function(response) {
// expects a JSON encode ARRAY of resource/endpoint urls
return response.json();
}).then(function(urls) {
cache.add(offlineFile);
re
rom endpoint strategy.
An API request is made (precache_endpoint), this is expected to return an JSON ARRAY of resources/request uri's that would
then be fetched and cached for use in later requests
package Progressive::Web::Application::Template::Base;
use strict;
use JSON qw//;
our $JSON;
BEGIN { $JSON = JSON->new->utf8->pretty(1)->allow_nonref->allow_blessed; }
sub new {
my $self = bless {},
lates->{$key} =~ s/\{($dataReg)\}/_encode_json($_[1]->{$1})/eg;
$templates->{$key} =~ s/\s*$//;
}
return $templates;
}
sub _encode_json {
my $val = $JSON->encode($_[0]);
chomp($val);
return $v
e::LicenseUtils->guess_license_from_meta($meta_str);
#pod
#pod Given the content of the META.(yml|json) file found in a CPAN distribution, this
#pod method makes a guess as to which licenses may apply
= Software::LicenseUtils->guess_license_from_meta($meta_str);
Given the content of the META.(yml|json) file found in a CPAN distribution, this
method makes a guess as to which licenses may apply to t
od
#pod This method returns the string that should be used for this license in the CPAN
#pod META.json or META.yml file, according to the CPAN Meta spec v2, or undef if
#pod there is no known string t
#pod =head1 LOOKING UP LICENSE CLASSES
#pod
#pod If you have an entry in a F<META.yml> or F<META.json> file, or similar
#pod metadata, and want to look up the Software::License class to use, there ar
meta2_name
This method returns the string that should be used for this license in the CPAN
META.json or META.yml file, according to the CPAN Meta spec v2, or undef if
there is no known string to use
onse) {
return response ? response.clone() : requestWith === 'XMLHttpRequest' ? new Response(JSON.stringify({
error: "Network issues, try again when you're back online"
})) : htmlRespo
response for the passed request if found then this is returned else
it will fall back to either a JSON response or the Response that is cached via the 'offline_path' param based upon the requestWith h
::ProjectDistDir qw( :all );
use Carp qw( croak );
use JSON::MaybeXS;
use Langertha::Engine::OpenAI;
with 'Langertha::Role::'.$_ for (qw(
JSON
HTTP
OpenAPI
Models
Seed
Temperature
Cont
') };
has keep_alive => (
isa => 'Str',
is => 'ro',
predicate => 'has_keep_alive',
);
has json_format => (
isa => 'Bool',
is => 'ro',
default => sub {0},
);
sub embedding_request {
my
model => $self->chat_model,
messages => $messages,
stream => JSON->false,
$self->json_format ? ( format => 'json' ) : (),
$self->has_keep_alive ? ( keep_alive => $self->keep_alive
/ 'json';
croak 'Stray options passed' if scalar keys %opts;
$store->in_transaction(rw => sub {
if ($format eq 'json') {
require JSON;
my $json =
local $/ = undef;
JSON::decode_json(<$handle>);
}->{files};
foreach my $dbname (keys %{$json}) {
my $file = $store->que
ry(dbname => $dbname);
my $d = $json->{$dbname};
$d = {
properties => $d->{properties} // {},
digests => $d