| 1 | package SBOM::CycloneDX::ReleaseNotes; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use 5.010001; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use SBOM::CycloneDX::List; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | ▶ | use SBOM::CycloneDX::Timestamp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 1 | ▶ | use Types::Standard qw(Str InstanceOf); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 1 | ▶ | use Types::TypeTiny qw(ArrayLike); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | 1 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | 1 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | |||||||||||
| 17 | 1 | extends 'SBOM::CycloneDX::Base'; | |||||||||
| 18 | |||||||||||
| 19 | 1 | has type => (is => 'rw', isa => Str, required => 1); | |||||||||
| 20 | 1 | has title => (is => 'rw', isa => Str); | |||||||||
| 21 | 1 | has featured_image => (is => 'rw', isa => Str); # URL | |||||||||
| 22 | 1 | has social_image => (is => 'rw', isa => Str); | |||||||||
| 23 | 1 | has description => (is => 'rw', isa => Str); | |||||||||
| 24 | |||||||||||
| 25 | has timestamp => ( | ||||||||||
| 26 | is => 'rw', | ||||||||||
| 27 | isa => InstanceOf ['SBOM::CycloneDX::Timestamp'], | ||||||||||
| 28 | 0 | ▶ | coerce => sub { ref($_[0]) ? $_[0] : SBOM::CycloneDX::Timestamp->new($_[0]) } | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
| |||||||||||
| 29 | 1 | ); | |||||||||
| 30 | |||||||||||
| 31 | 0 | ▶ | has aliases => (is => 'rw', isa => ArrayLike [Str], default => sub { SBOM::CycloneDX::List->new }); | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||
| 32 | 0 | ▶ | has tags => (is => 'rw', isa => ArrayLike [Str], default => sub { SBOM::CycloneDX::List->new }); | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||
| 33 | |||||||||||
| 34 | has resolves => ( | ||||||||||
| 35 | is => 'rw', | ||||||||||
| 36 | isa => ArrayLike [InstanceOf ['SBOM::CycloneDX::Issue']], | ||||||||||
| 37 | 0 | ▶ | default => sub { SBOM::CycloneDX::List->new } | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 38 | 1 | ); | |||||||||
| 39 | |||||||||||
| 40 | has notes => ( | ||||||||||
| 41 | is => 'rw', | ||||||||||
| 42 | isa => ArrayLike [InstanceOf ['SBOM::CycloneDX::Note']], | ||||||||||
| 43 | 0 | ▶ | default => sub { SBOM::CycloneDX::List->new } | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 44 | 1 | ); | |||||||||
| 45 | |||||||||||
| 46 | has properties => ( | ||||||||||
| 47 | is => 'rw', | ||||||||||
| 48 | isa => ArrayLike [InstanceOf ['SBOM::CycloneDX::Property']], | ||||||||||
| 49 | 0 | ▶ | default => sub { SBOM::CycloneDX::List->new } | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 50 | 1 | ); | |||||||||
| 51 | |||||||||||
| 52 | 0 | ▶ | sub TO_JSON { | ||||||||
|
Subroutine
TO_JSON: not called CC=11 SCAR=48.8
Pod
documented
| |||||||||||
| 53 | |||||||||||
| 54 | 0 | my $self = shift; | |||||||||
| 55 | |||||||||||
| 56 | 0 | my $json = {type => $self->type}; | |||||||||
| 57 | |||||||||||
| 58 | 0 | ▶ | $json->{title} = $self->title if $self->title; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 59 | 0 | ▶ | $json->{featuredImage} = $self->featured_image if $self->featured_image; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 60 | 0 | ▶ | $json->{socialImage} = $self->social_image if $self->social_image; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 61 | 0 | ▶ | $json->{description} = $self->description if $self->description; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 62 | 0 | ▶ | $json->{timestamp} = $self->timestamp if $self->timestamp; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 63 | 0 | ▶ | $json->{aliases} = $self->aliases if @{$self->aliases}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 64 | 0 | ▶ | $json->{tags} = $self->tags if @{$self->tags}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 65 | 0 | ▶ | $json->{resolves} = $self->resolves if @{$self->resolves}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 66 | 0 | ▶ | $json->{notes} = $self->notes if @{$self->notes}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 67 | 0 | ▶ | $json->{properties} = $self->properties if @{$self->properties}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 68 | |||||||||||
| 69 | 0 | return $json; | |||||||||
| 70 | |||||||||||
| 71 | } | ||||||||||
| 72 | |||||||||||
| 73 | 1 | 1; | |||||||||
| 74 | |||||||||||
| 75 | =encoding utf-8 | ||||||||||
| 76 | |||||||||||
| 77 | =head1 NAME | ||||||||||
| 78 | |||||||||||
| 79 | SBOM::CycloneDX::ReleaseNotes - Specifies release notes | ||||||||||
| 80 | |||||||||||
| 81 | =head1 SYNOPSIS | ||||||||||
| 82 | |||||||||||
| 83 | $release_notes = SBOM::CycloneDX::ReleaseNotes->new( | ||||||||||
| 84 | type => 'major' | ||||||||||
| 85 | ); | ||||||||||
| 86 | |||||||||||
| 87 | |||||||||||
| 88 | =head1 DESCRIPTION | ||||||||||
| 89 | |||||||||||
| 90 | L<SBOM::CycloneDX::ReleaseNotes> provides the release notes. | ||||||||||
| 91 | |||||||||||
| 92 | =head2 METHODS | ||||||||||
| 93 | |||||||||||
| 94 | L<SBOM::CycloneDX::ReleaseNotes> inherits all methods from L<SBOM::CycloneDX::Base> | ||||||||||
| 95 | and implements the following new ones. | ||||||||||
| 96 | |||||||||||
| 97 | =over | ||||||||||
| 98 | |||||||||||
| 99 | =item SBOM::CycloneDX::ReleaseNotes->new( %PARAMS ) | ||||||||||
| 100 | |||||||||||
| 101 | Properties: | ||||||||||
| 102 | |||||||||||
| 103 | =over | ||||||||||
| 104 | |||||||||||
| 105 | =item * C<type>, The software versioning type the release note describes. | ||||||||||
| 106 | |||||||||||
| 107 | =item * C<title>, The title of the release. | ||||||||||
| 108 | |||||||||||
| 109 | =item * C<featured_image>, The URL to an image that may be prominently displayed | ||||||||||
| 110 | with the release note. | ||||||||||
| 111 | |||||||||||
| 112 | =item * C<social_image>, The URL to an image that may be used in messaging on | ||||||||||
| 113 | social media platforms. | ||||||||||
| 114 | |||||||||||
| 115 | =item * C<description>, A short description of the release. | ||||||||||
| 116 | |||||||||||
| 117 | =item * C<timestamp>, The date and time (timestamp) when the release note was | ||||||||||
| 118 | created. | ||||||||||
| 119 | |||||||||||
| 120 | =item * C<aliases>, One or more alternate names the release may be referred to. | ||||||||||
| 121 | This may include unofficial terms used by development and marketing teams (e.g. | ||||||||||
| 122 | code names). | ||||||||||
| 123 | |||||||||||
| 124 | =item * C<tags>, Textual strings that aid in discovery, search, and retrieval of | ||||||||||
| 125 | the associated object. Tags often serve as a way to group or categorize similar | ||||||||||
| 126 | or related objects by various attributes. | ||||||||||
| 127 | |||||||||||
| 128 | =item * C<resolves>, A collection of issues that have been resolved. | ||||||||||
| 129 | See L<SBOM::CycloneDX::Issue> | ||||||||||
| 130 | |||||||||||
| 131 | =item * C<notes>, Zero or more release notes containing the locale and content. | ||||||||||
| 132 | Multiple note objects may be specified to support release notes in a wide variety | ||||||||||
| 133 | of languages. See L<SBOM::CycloneDX::Note> | ||||||||||
| 134 | |||||||||||
| 135 | =item * C<properties>, Provides the ability to document properties in a name-value | ||||||||||
| 136 | store. This provides flexibility to include data not officially supported in the | ||||||||||
| 137 | standard without having to use additional namespaces or create extensions. | ||||||||||
| 138 | Unlike key-value stores, properties support duplicate names, each potentially | ||||||||||
| 139 | having different values. Property names of interest to the general public are | ||||||||||
| 140 | encouraged to be registered in the CycloneDX Property Taxonomy. Formal | ||||||||||
| 141 | registration is optional. See L<SBOM::CycloneDX::Property> | ||||||||||
| 142 | |||||||||||
| 143 | =back | ||||||||||
| 144 | |||||||||||
| 145 | =item $release_notes->type | ||||||||||
| 146 | |||||||||||
| 147 | =item $release_notes->title | ||||||||||
| 148 | |||||||||||
| 149 | =item $release_notes->featured_image | ||||||||||
| 150 | |||||||||||
| 151 | =item $release_notes->social_image | ||||||||||
| 152 | |||||||||||
| 153 | =item $release_notes->description | ||||||||||
| 154 | |||||||||||
| 155 | =item $release_notes->timestamp | ||||||||||
| 156 | |||||||||||
| 157 | =item $release_notes->aliases | ||||||||||
| 158 | |||||||||||
| 159 | =item $release_notes->tags | ||||||||||
| 160 | |||||||||||
| 161 | =item $release_notes->resolves | ||||||||||
| 162 | |||||||||||
| 163 | =item $release_notes->notes | ||||||||||
| 164 | |||||||||||
| 165 | =item $release_notes->properties | ||||||||||
| 166 | |||||||||||
| 167 | |||||||||||
| 168 | =back | ||||||||||
| 169 | |||||||||||
| 170 | =head1 SUPPORT | ||||||||||
| 171 | |||||||||||
| 172 | =head2 Bugs / Feature Requests | ||||||||||
| 173 | |||||||||||
| 174 | Please report any bugs or feature requests through the issue tracker | ||||||||||
| 175 | at L<https://github.com/giterlizzi/perl-SBOM-CycloneDX/issues>. | ||||||||||
| 176 | You will be notified automatically of any progress on your issue. | ||||||||||
| 177 | |||||||||||
| 178 | =head2 Source Code | ||||||||||
| 179 | |||||||||||
| 180 | This is open source software. The code repository is available for | ||||||||||
| 181 | public review and contribution under the terms of the license. | ||||||||||
| 182 | |||||||||||
| 183 | L<https://github.com/giterlizzi/perl-SBOM-CycloneDX> | ||||||||||
| 184 | |||||||||||
| 185 | git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git | ||||||||||
| 186 | |||||||||||
| 187 | |||||||||||
| 188 | =head1 AUTHOR | ||||||||||
| 189 | |||||||||||
| 190 | =over 4 | ||||||||||
| 191 | |||||||||||
| 192 | =item * Giuseppe Di Terlizzi <gdt@cpan.org> | ||||||||||
| 193 | |||||||||||
| 194 | =back | ||||||||||
| 195 | |||||||||||
| 196 | |||||||||||
| 197 | =head1 LICENSE AND COPYRIGHT | ||||||||||
| 198 | |||||||||||
| 199 | This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi. | ||||||||||
| 200 | |||||||||||
| 201 | This is free software; you can redistribute it and/or modify it under | ||||||||||
| 202 | the same terms as the Perl 5 programming language system itself. | ||||||||||
| 203 | |||||||||||
| 204 | =cut | ||||||||||