Skip to content
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 .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ reviews:
review_status: true
auto_review:
enabled: true
base_branches: ["main", "customer-portal-.*", "release.*"]
base_branches: ["main", "customer-portal-.*", "release.*", "dev-.*"]
chat:
auto_reply: true
1 change: 1 addition & 0 deletions apps/customer-portal/backend/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ modules = [
{org = "wso2", packageName = "customer_portal", moduleName = "customer_portal.authorization"},
{org = "wso2", packageName = "customer_portal", moduleName = "customer_portal.entity"},
{org = "wso2", packageName = "customer_portal", moduleName = "customer_portal.scim"},
{org = "wso2", packageName = "customer_portal", moduleName = "customer_portal.types"},
{org = "wso2", packageName = "customer_portal", moduleName = "customer_portal.updates"}
]

1 change: 0 additions & 1 deletion apps/customer-portal/backend/constants.bal
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@ public const int DEFAULT_OFFSET = 0;
public const int DEFAULT_LIMIT = 10;

public const ERR_STATUS_CODE = "statusCode";
public const PHONE_PATTERN_STRING = "^\\+\\d{10,14}$";
public const ERR_BODY = "body";
5 changes: 3 additions & 2 deletions apps/customer-portal/backend/mock.bal
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
import customer_portal.types;

final ProductVulnerability[] & readonly MOCK_PRODUCT_VULNERABILITIES = [
final types:ProductVulnerability[] & readonly MOCK_PRODUCT_VULNERABILITIES = [
{
id: "8f3d2c1a9b7e4d6f8a1c2b3d4e5f6a7b",
cveId: "CVE-2099-5555",
Expand Down Expand Up @@ -62,7 +63,7 @@ final ProductVulnerability[] & readonly MOCK_PRODUCT_VULNERABILITIES = [
}
];

final ProductVulnerabilityResponse & readonly MOCK_PRODUCT_VULNERABILITY = {
final types:ProductVulnerabilityResponse & readonly MOCK_PRODUCT_VULNERABILITY = {
id: "abcdef1234567890fedcba0987654321",
cveId: "CVE-2099-3333",
vulnerabilityId: "XRAY-999003",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import customer_portal.entity;

import ballerina/constraint;

public const PHONE_PATTERN_STRING = "^\\+\\d{10,14}$";

# Cache configuration record.
public type CacheConfig record {|
# Maximum number of entries in cache
Expand Down Expand Up @@ -399,3 +401,159 @@ public type ProductVulnerabilitySearchResponse record {|
int totalRecords;
*entity:Pagination;
|};

# Basic product information.
public type BasicProductInfo record {|
# Product name
@constraint:String {minLength: 1}
string productName;
# Product base version
@constraint:String {minLength: 1}
string productBaseVersion;
# Channel
@constraint:String {minLength: 1}
string channel;
|};

# Recommended update level.
public type RecommendedUpdateLevel record {|
# Product name
string productName;
# Product base version
string productBaseVersion;
# Channel
string channel;
# Starting update level
int startingUpdateLevel;
# Ending update level
int endingUpdateLevel;
# Installed updates count
int installedUpdatesCount;
# Installed security updates count
int installedSecurityUpdatesCount;
# Timestamp
int timestamp;
# Recommended update level
int recommendedUpdateLevel;
# Available updates count
int availableUpdatesCount;
# Available security updates count
int availableSecurityUpdatesCount;
|};

# File changes.
public type FileChanges record {|
# Added files
BasicFileInfo[] addedFiles;
# Modified files
ModifiedFileInfo[] modifiedFiles;
# Removed files
string[] removedFiles;
# Changes in bundles info
BundlesInfoChange[] bundlesInfoChanges;
|};

# Basic file information.
public type BasicFileInfo record {|
# File path
string filePath;
# MD5 checksum
string md5sum;
# SHA256 checksum
string sha256;
# JWT token
string jwt;
# Download URL
string downloadUrl;
|};

# Modified file information.
public type ModifiedFileInfo record {|
# Type
string 'type;
# Original file
BasicFileInfo originalFile;
# New file
BasicFileInfo newFile;
|};

# Changes in bundles info.
public type BundlesInfoChange record {|
# Bundles info path
string bundlesInfoPath;
# Content change
string contentChange;
# Change type
ChangeType changeType;
# Order
int 'order;
|};

# Change type.
public type ChangeType record {|
# Value
string value;
|};

# Update response.
public type UpdateResponse record {|
# File changes
FileChanges fileChanges;
# JWT token
string jwt;
# Platform name
string platformName;
# Platform version
string platformVersion;
# Product name
string productName;
# Product base version
string productBaseVersion;
# Starting update level
string startingUpdateLevel;
# Ending update level
string endingUpdateLevel;
# Environment
string environment;
# Update summary message
string updateSummaryMessage;
# Update security message
string updateSecurityMessage;
# Total updates
int totalUpdates;
# Total security updates
int totalSecurityUpdates;
# Applied update numbers
int[] appliedUpdateNumbers;
|};

# Update payload for listing updates.
public type ListUpdatePayload record {|
*BasicProductInfo;
# Starting update level
@constraint:String {minLength: 1}
string startUpdateLevel;
# Ending update level
@constraint:String {minLength: 1}
string endUpdateLevel;
# Hotfixes
string[] hotFixes;
|};

# Product update level.
public type ProductUpdateLevel record {|
# Product name
string productName;
# Product update levels
UpdateLevel[] productUpdateLevels;
|};

# Update level.
public type UpdateLevel record {|
# Product base version
string productBaseVersion;
# Channel
string channel;
# Update level
int[] updateLevels;
|};
Loading