@hapic/harbor
Version:
A harbor http api client.
34 lines (33 loc) • 953 B
TypeScript
import type { ResourceCollectionQuery } from '../type';
import type { RobotPermissionAction, RobotPermissionResource } from './constants';
export type RobotPermissionAccess = {
resource: `${RobotPermissionResource}`;
action: `${RobotPermissionAction}`;
};
export type RobotPermission = {
access: RobotPermissionAccess[];
kind: 'project';
namespace: string;
};
export type Robot = {
id: number;
description?: string;
name: string;
secret?: string | null;
creation_time?: string;
update_time?: string;
expires_at?: number;
duration?: number;
level?: 'system';
disable?: boolean;
editable?: boolean;
permissions?: RobotPermission[];
};
export type RobotGetManyContext = {
query?: ResourceCollectionQuery<Robot>;
};
export type RobotCreatePayload = Omit<Robot, 'id'>;
export type RobotUpdatePayload = Omit<Robot, 'id'>;
export type RobotUpdateSecretResponse = {
secret: string;
};