2018-12-29 10:01:43 +01:00
|
|
|
import { Observable } from 'rxjs';
|
|
|
|
import { ClrModal } from '@clr/angular';
|
2019-05-21 07:43:27 +02:00
|
|
|
import { HttpHeaders, HttpParams } from '@angular/common/http';
|
2018-12-29 10:01:43 +01:00
|
|
|
|
2017-04-20 08:58:31 +02:00
|
|
|
/**
|
|
|
|
* The base interface contains the general properties
|
2018-05-14 14:01:00 +02:00
|
|
|
*
|
2018-09-04 09:01:50 +02:00
|
|
|
**
|
|
|
|
* interface Base
|
2017-04-20 08:58:31 +02:00
|
|
|
*/
|
|
|
|
export interface Base {
|
2022-05-13 10:00:45 +02:00
|
|
|
id?: string | number;
|
|
|
|
name?: string;
|
|
|
|
creation_time?: Date;
|
|
|
|
update_time?: Date;
|
2017-04-20 08:58:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface for registry endpoints.
|
2018-05-14 14:01:00 +02:00
|
|
|
*
|
2018-09-04 09:01:50 +02:00
|
|
|
**
|
|
|
|
* interface Endpoint
|
|
|
|
* extends {Base}
|
2017-04-20 08:58:31 +02:00
|
|
|
*/
|
2017-05-11 08:59:12 +02:00
|
|
|
export interface Endpoint extends Base {
|
2022-05-13 10:00:45 +02:00
|
|
|
credential: {
|
|
|
|
access_key?: string;
|
|
|
|
access_secret?: string;
|
|
|
|
type: string;
|
|
|
|
};
|
|
|
|
description: string;
|
|
|
|
insecure: boolean;
|
|
|
|
name: string;
|
2019-02-25 09:00:31 +01:00
|
|
|
type: string;
|
2022-05-13 10:00:45 +02:00
|
|
|
url: string;
|
|
|
|
status?: string;
|
2019-02-25 09:00:31 +01:00
|
|
|
}
|
|
|
|
|
2019-04-22 09:05:51 +02:00
|
|
|
export interface PingEndpoint extends Base {
|
2022-05-13 10:00:45 +02:00
|
|
|
access_key?: string;
|
|
|
|
access_secret?: string;
|
|
|
|
description: string;
|
|
|
|
insecure: boolean;
|
|
|
|
name: string;
|
|
|
|
type: string;
|
|
|
|
url: string;
|
2019-04-22 09:05:51 +02:00
|
|
|
}
|
|
|
|
|
2019-03-25 03:20:45 +01:00
|
|
|
export interface Filter {
|
2022-05-13 10:00:45 +02:00
|
|
|
type: string;
|
|
|
|
style: string;
|
|
|
|
decoration?: string;
|
|
|
|
values?: string[];
|
2019-03-25 03:20:45 +01:00
|
|
|
}
|
|
|
|
|
2018-03-07 03:03:08 +01:00
|
|
|
export class Filter {
|
2022-05-13 10:00:45 +02:00
|
|
|
type: string;
|
|
|
|
value?: any;
|
|
|
|
constructor(type: string) {
|
|
|
|
this.type = type;
|
|
|
|
}
|
2018-03-07 03:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export class Trigger {
|
2022-05-13 10:00:45 +02:00
|
|
|
type: string;
|
|
|
|
trigger_settings:
|
|
|
|
| any
|
|
|
|
| {
|
|
|
|
[key: string]: any | any[];
|
|
|
|
};
|
|
|
|
constructor(type: string, param: any | { [key: string]: any | any[] }) {
|
|
|
|
this.type = type;
|
|
|
|
this.trigger_settings = param;
|
|
|
|
}
|
2017-05-10 09:41:20 +02:00
|
|
|
}
|
2017-04-20 08:58:31 +02:00
|
|
|
|
2019-03-18 11:22:59 +01:00
|
|
|
/**
|
|
|
|
* Interface for replication tasks item.
|
|
|
|
*
|
|
|
|
**
|
|
|
|
* interface ReplicationTasks
|
|
|
|
*/
|
|
|
|
export interface ReplicationTasks extends Base {
|
2022-05-13 10:00:45 +02:00
|
|
|
[key: string]: any | any[];
|
|
|
|
operation: string;
|
|
|
|
id: number;
|
|
|
|
execution_id: number;
|
|
|
|
resource_type: string;
|
|
|
|
src_resource: string;
|
|
|
|
dst_resource: string;
|
|
|
|
job_id: number;
|
|
|
|
status: string;
|
2019-03-18 11:22:59 +01:00
|
|
|
}
|
2017-06-07 08:36:55 +02:00
|
|
|
/**
|
|
|
|
* Interface for storing metadata of response.
|
2018-05-14 14:01:00 +02:00
|
|
|
*
|
2018-09-04 09:01:50 +02:00
|
|
|
**
|
|
|
|
* interface Metadata
|
2017-06-07 08:36:55 +02:00
|
|
|
*/
|
|
|
|
export interface Metadata {
|
2022-05-13 10:00:45 +02:00
|
|
|
xTotalCount: number;
|
2017-06-07 08:36:55 +02:00
|
|
|
}
|
|
|
|
|
2017-04-20 08:58:31 +02:00
|
|
|
/**
|
|
|
|
* Interface for access log.
|
2018-05-14 14:01:00 +02:00
|
|
|
*
|
2018-09-04 09:01:50 +02:00
|
|
|
**
|
|
|
|
* interface AccessLog
|
2017-04-20 08:58:31 +02:00
|
|
|
*/
|
2017-05-04 11:09:55 +02:00
|
|
|
export interface AccessLog {
|
2022-05-13 10:00:45 +02:00
|
|
|
metadata?: Metadata;
|
|
|
|
data: AccessLogItem[];
|
2017-06-07 08:36:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The access log data.
|
2018-05-14 14:01:00 +02:00
|
|
|
*
|
2018-09-04 09:01:50 +02:00
|
|
|
**
|
|
|
|
* interface AccessLogItem
|
2017-06-07 08:36:55 +02:00
|
|
|
*/
|
|
|
|
export interface AccessLogItem {
|
2022-05-13 10:00:45 +02:00
|
|
|
[key: string]: any | any[];
|
|
|
|
log_id: number;
|
|
|
|
project_id: number;
|
|
|
|
repo_name: string;
|
|
|
|
repo_tag: string;
|
|
|
|
operation: string;
|
|
|
|
op_time: string | Date;
|
|
|
|
user_id: number;
|
|
|
|
username: string;
|
|
|
|
keywords?: string; // NOT used now
|
|
|
|
guid?: string; // NOT used now
|
2017-05-15 12:40:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-06-07 12:47:18 +02:00
|
|
|
* Global system info.
|
2018-05-14 14:01:00 +02:00
|
|
|
*
|
2018-09-04 09:01:50 +02:00
|
|
|
**
|
|
|
|
* interface SystemInfo
|
2018-05-14 14:01:00 +02:00
|
|
|
*
|
2017-05-15 12:40:13 +02:00
|
|
|
*/
|
2017-06-07 12:47:18 +02:00
|
|
|
export interface SystemInfo {
|
2022-05-13 10:00:45 +02:00
|
|
|
with_trivy?: boolean;
|
|
|
|
with_notary?: boolean;
|
|
|
|
with_admiral?: boolean;
|
|
|
|
with_chartmuseum?: boolean;
|
|
|
|
admiral_endpoint?: string;
|
|
|
|
auth_mode?: string;
|
2023-02-08 18:11:08 +01:00
|
|
|
primary_auth_mode?: boolean;
|
2022-05-13 10:00:45 +02:00
|
|
|
registry_url?: string;
|
|
|
|
project_creation_restriction?: string;
|
|
|
|
self_registration?: boolean;
|
|
|
|
has_ca_root?: boolean;
|
|
|
|
harbor_version?: string;
|
|
|
|
clair_vulnerability_status?: ClairDBStatus;
|
|
|
|
next_scan_all?: number;
|
|
|
|
external_url?: string;
|
2017-07-13 07:04:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clair database status info.
|
2018-05-14 14:01:00 +02:00
|
|
|
*
|
2018-09-04 09:01:50 +02:00
|
|
|
**
|
|
|
|
* interface ClairDetail
|
2017-07-13 07:04:42 +02:00
|
|
|
*/
|
|
|
|
export interface ClairDetail {
|
2022-05-13 10:00:45 +02:00
|
|
|
namespace: string;
|
|
|
|
last_update: number;
|
2017-07-13 07:04:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ClairDBStatus {
|
2022-05-13 10:00:45 +02:00
|
|
|
overall_last_update: number;
|
|
|
|
details: ClairDetail[];
|
2017-05-25 02:44:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export enum VulnerabilitySeverity {
|
2022-05-13 10:00:45 +02:00
|
|
|
_SEVERITY,
|
|
|
|
NONE,
|
|
|
|
UNKNOWN,
|
|
|
|
LOW,
|
|
|
|
MEDIUM,
|
|
|
|
HIGH,
|
2017-05-25 02:44:47 +02:00
|
|
|
}
|
|
|
|
|
2017-06-12 13:40:51 +02:00
|
|
|
export interface VulnerabilityBase {
|
2022-05-13 10:00:45 +02:00
|
|
|
id: string;
|
|
|
|
severity: string;
|
|
|
|
package: string;
|
|
|
|
version: string;
|
2017-05-25 02:44:47 +02:00
|
|
|
}
|
|
|
|
|
2017-06-12 13:40:51 +02:00
|
|
|
export interface VulnerabilityItem extends VulnerabilityBase {
|
2022-05-13 10:00:45 +02:00
|
|
|
links: string[];
|
|
|
|
fix_version: string;
|
|
|
|
layer?: string;
|
|
|
|
description?: string;
|
|
|
|
preferred_cvss?: { [key: string]: string | number };
|
|
|
|
vendor_attributes?: {
|
|
|
|
CVSS?: { [key: string]: any };
|
|
|
|
};
|
2017-05-25 02:44:47 +02:00
|
|
|
}
|
|
|
|
|
2017-06-12 13:40:51 +02:00
|
|
|
export interface VulnerabilitySummary {
|
2019-10-10 11:42:45 +02:00
|
|
|
report_id?: string;
|
|
|
|
mime_type?: string;
|
|
|
|
scan_status?: string;
|
|
|
|
severity?: string;
|
|
|
|
duration?: number;
|
|
|
|
summary?: SeveritySummary;
|
|
|
|
start_time?: Date;
|
|
|
|
end_time?: Date;
|
2019-11-15 03:14:46 +01:00
|
|
|
scanner?: ScannerVo;
|
2020-03-12 12:30:12 +01:00
|
|
|
complete_percent?: number;
|
2019-11-15 03:14:46 +01:00
|
|
|
}
|
|
|
|
export interface ScannerVo {
|
|
|
|
name?: string;
|
|
|
|
vendor?: string;
|
|
|
|
version?: string;
|
2019-10-10 11:42:45 +02:00
|
|
|
}
|
|
|
|
export interface SeveritySummary {
|
2022-05-13 10:00:45 +02:00
|
|
|
total: number;
|
|
|
|
fixable: number;
|
|
|
|
summary: { [key: string]: number };
|
2019-10-10 11:42:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface VulnerabilityDetail {
|
2022-05-13 10:00:45 +02:00
|
|
|
'application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0'?: VulnerabilityReport;
|
2019-10-10 11:42:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface VulnerabilityReport {
|
2022-05-13 10:00:45 +02:00
|
|
|
vulnerabilities?: VulnerabilityItem[];
|
2019-10-10 11:42:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ScanOverview {
|
2022-05-13 10:00:45 +02:00
|
|
|
'application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0'?: VulnerabilitySummary;
|
2017-06-19 18:51:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface VulnerabilityComponents {
|
2022-05-13 10:00:45 +02:00
|
|
|
total: number;
|
|
|
|
summary: VulnerabilitySeverityMetrics[];
|
2017-06-19 18:51:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface VulnerabilitySeverityMetrics {
|
2022-05-13 10:00:45 +02:00
|
|
|
severity: VulnerabilitySeverity;
|
|
|
|
count: number;
|
2017-06-18 15:59:56 +02:00
|
|
|
}
|
|
|
|
|
2020-02-13 08:39:29 +01:00
|
|
|
export interface ArtifactClickEvent {
|
2022-05-13 10:00:45 +02:00
|
|
|
project_id: string | number;
|
|
|
|
repository_name: string;
|
|
|
|
digest: string;
|
|
|
|
artifact_id: number;
|
2017-10-24 06:56:23 +02:00
|
|
|
}
|
2018-03-23 02:58:06 +01:00
|
|
|
|
|
|
|
export interface Label {
|
2022-05-13 10:00:45 +02:00
|
|
|
[key: string]: any | any[];
|
|
|
|
name: string;
|
|
|
|
description: string;
|
|
|
|
color: string;
|
|
|
|
scope: string;
|
|
|
|
project_id: number;
|
2018-03-23 02:58:06 +01:00
|
|
|
}
|
2019-07-10 11:28:05 +02:00
|
|
|
|
|
|
|
export interface Quota {
|
|
|
|
id: number;
|
2022-05-13 10:00:45 +02:00
|
|
|
ref: {
|
|
|
|
name: string;
|
|
|
|
owner_name: string;
|
|
|
|
id: number;
|
|
|
|
} | null;
|
|
|
|
creation_time: string;
|
|
|
|
update_time: string;
|
|
|
|
hard: {
|
|
|
|
storage: number;
|
|
|
|
};
|
|
|
|
used: {
|
|
|
|
storage: number;
|
|
|
|
};
|
2019-07-10 11:28:05 +02:00
|
|
|
}
|
|
|
|
export interface QuotaHard {
|
2022-05-13 10:00:45 +02:00
|
|
|
hard: QuotaStorage;
|
2019-07-10 11:28:05 +02:00
|
|
|
}
|
2020-04-05 20:40:25 +02:00
|
|
|
export interface QuotaStorage {
|
2022-05-13 10:00:45 +02:00
|
|
|
storage: number;
|
2019-07-10 11:28:05 +02:00
|
|
|
}
|
|
|
|
|
2018-03-19 08:25:55 +01:00
|
|
|
export interface CardItemEvent {
|
2022-05-13 10:00:45 +02:00
|
|
|
event_type: string;
|
|
|
|
item: any;
|
|
|
|
additional_info?: any;
|
2018-03-19 08:25:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ScrollPosition {
|
2022-05-13 10:00:45 +02:00
|
|
|
sH: number;
|
|
|
|
sT: number;
|
|
|
|
cH: number;
|
2018-05-14 14:01:00 +02:00
|
|
|
}
|
2018-10-12 12:41:45 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The manifest of image.
|
|
|
|
*
|
|
|
|
**
|
|
|
|
* interface Manifest
|
|
|
|
*/
|
|
|
|
export interface Manifest {
|
2022-05-13 10:00:45 +02:00
|
|
|
manifset: Object;
|
|
|
|
config: string;
|
2018-10-10 05:08:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface RetagRequest {
|
2022-05-13 10:00:45 +02:00
|
|
|
targetProject: string;
|
|
|
|
targetRepo: string;
|
|
|
|
targetTag: string;
|
|
|
|
srcImage: string;
|
|
|
|
override: boolean;
|
2018-10-12 12:41:45 +02:00
|
|
|
}
|
2018-12-29 10:01:43 +01:00
|
|
|
|
|
|
|
export interface ClrDatagridComparatorInterface<T> {
|
2022-05-13 10:00:45 +02:00
|
|
|
compare(a: T, b: T): number;
|
2018-12-29 10:01:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ClrDatagridStateInterface {
|
2022-05-13 10:00:45 +02:00
|
|
|
page?: { from?: number; to?: number; size?: number };
|
|
|
|
sort?: {
|
|
|
|
by: string | ClrDatagridComparatorInterface<any>;
|
|
|
|
reverse: boolean;
|
|
|
|
};
|
|
|
|
filters?: (
|
|
|
|
| { property: string; value: string }
|
|
|
|
| ClrDatagridFilterInterface<any>
|
|
|
|
)[];
|
2018-12-29 10:01:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ClrDatagridFilterInterface<T> {
|
2022-05-13 10:00:45 +02:00
|
|
|
isActive(): boolean;
|
2018-12-29 10:01:43 +01:00
|
|
|
|
2022-05-13 10:00:45 +02:00
|
|
|
accepts(item: T): boolean;
|
2018-12-29 10:01:43 +01:00
|
|
|
|
2022-05-13 10:00:45 +02:00
|
|
|
changes: Observable<any>;
|
2018-12-29 10:01:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/** @deprecated since 0.11 */
|
2022-05-13 10:00:45 +02:00
|
|
|
export interface Comparator<T> extends ClrDatagridComparatorInterface<T> {}
|
2018-12-29 10:01:43 +01:00
|
|
|
/** @deprecated since 0.11 */
|
2022-05-13 10:00:45 +02:00
|
|
|
export interface ClrFilter<T> extends ClrDatagridFilterInterface<T> {}
|
2018-12-29 10:01:43 +01:00
|
|
|
/** @deprecated since 0.11 */
|
2022-05-13 10:00:45 +02:00
|
|
|
export interface State extends ClrDatagridStateInterface {}
|
|
|
|
export interface Modal extends ClrModal {}
|
2018-12-29 10:01:43 +01:00
|
|
|
export const Modal = ClrModal;
|
2019-01-09 09:08:56 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The access user privilege from serve.
|
|
|
|
*
|
|
|
|
**
|
|
|
|
* interface UserPrivilegeServe
|
|
|
|
*/
|
|
|
|
export interface UserPrivilegeServeItem {
|
2022-05-13 10:00:45 +02:00
|
|
|
[key: string]: any | any[];
|
|
|
|
resource: string;
|
|
|
|
action: string;
|
2019-01-09 09:08:56 +01:00
|
|
|
}
|
|
|
|
|
2019-03-05 19:09:48 +01:00
|
|
|
export class OriginCron {
|
2022-05-13 10:00:45 +02:00
|
|
|
type: string;
|
|
|
|
cron: string;
|
2019-03-05 19:09:48 +01:00
|
|
|
}
|
|
|
|
|
2019-07-10 11:28:05 +02:00
|
|
|
export interface HttpOptionInterface {
|
2022-05-13 10:00:45 +02:00
|
|
|
headers?:
|
|
|
|
| HttpHeaders
|
|
|
|
| {
|
|
|
|
[header: string]: string | string[];
|
|
|
|
};
|
|
|
|
observe?: 'body';
|
|
|
|
params?:
|
|
|
|
| HttpParams
|
|
|
|
| {
|
|
|
|
[param: string]: string | string[];
|
|
|
|
};
|
|
|
|
reportProgress?: boolean;
|
|
|
|
responseType: 'json';
|
|
|
|
withCredentials?: boolean;
|
2019-05-21 07:43:27 +02:00
|
|
|
}
|
|
|
|
|
2019-07-10 11:28:05 +02:00
|
|
|
export interface HttpOptionTextInterface {
|
2022-05-13 10:00:45 +02:00
|
|
|
headers?:
|
|
|
|
| HttpHeaders
|
|
|
|
| {
|
|
|
|
[header: string]: string | string[];
|
|
|
|
};
|
|
|
|
observe?: 'body';
|
|
|
|
params?:
|
|
|
|
| HttpParams
|
|
|
|
| {
|
|
|
|
[param: string]: string | string[];
|
|
|
|
};
|
|
|
|
reportProgress?: boolean;
|
|
|
|
responseType: 'text';
|
|
|
|
withCredentials?: boolean;
|
2019-05-21 07:43:27 +02:00
|
|
|
}
|
|
|
|
|
2019-07-10 11:28:05 +02:00
|
|
|
export interface ProjectRootInterface {
|
2022-05-13 10:00:45 +02:00
|
|
|
NAME: string;
|
|
|
|
VALUE: number;
|
|
|
|
LABEL: string;
|
2019-07-04 09:36:05 +02:00
|
|
|
}
|
2020-06-22 04:34:03 +02:00
|
|
|
export interface SystemCVEAllowlist {
|
2022-06-13 04:44:05 +02:00
|
|
|
id?: number;
|
|
|
|
project_id?: number;
|
|
|
|
expires_at?: number;
|
|
|
|
items?: Array<{ cve_id: string }>;
|
2019-07-10 11:28:05 +02:00
|
|
|
}
|
|
|
|
export interface QuotaHardInterface {
|
2022-05-13 10:00:45 +02:00
|
|
|
storage_per_project: number;
|
2019-07-10 11:28:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface QuotaUnitInterface {
|
2022-05-13 10:00:45 +02:00
|
|
|
UNIT: string;
|
2019-07-10 11:28:05 +02:00
|
|
|
}
|
|
|
|
export interface QuotaHardLimitInterface {
|
2022-05-13 10:00:45 +02:00
|
|
|
storageLimit: number;
|
|
|
|
storageUnit: string;
|
|
|
|
id?: string;
|
|
|
|
storageUsed?: string;
|
2019-07-10 11:28:05 +02:00
|
|
|
}
|
|
|
|
export interface EditQuotaQuotaInterface {
|
2022-05-13 10:00:45 +02:00
|
|
|
editQuota: string;
|
|
|
|
setQuota: string;
|
|
|
|
storageQuota: string;
|
|
|
|
quotaHardLimitValue: QuotaHardLimitInterface | any;
|
|
|
|
isSystemDefaultQuota: boolean;
|
2019-07-10 07:46:11 +02:00
|
|
|
}
|