fix: storage api alignment
This commit is contained in:
Vendored
+38
@@ -16,6 +16,43 @@ declare namespace Global {
|
||||
};
|
||||
}
|
||||
|
||||
interface K8sPageResponse<T> {
|
||||
apiVersion: string;
|
||||
items: T[];
|
||||
kind: string;
|
||||
metadata: {
|
||||
continue?: string;
|
||||
resourceVersion: string;
|
||||
selfLink?: string;
|
||||
[key: string]: any;
|
||||
};
|
||||
}
|
||||
|
||||
interface K8sCommonData {
|
||||
kind: string;
|
||||
apiVersion: string;
|
||||
metadata: {
|
||||
name: string;
|
||||
namespace: string;
|
||||
[key: string]: any;
|
||||
};
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
interface K8sSearchParams {
|
||||
allowWatchBookmarks?: boolean;
|
||||
continue?: string;
|
||||
fieldSelector?: string;
|
||||
labelSelector?: string;
|
||||
limit?: number;
|
||||
resourceVersion?: string;
|
||||
resourceVersionMatch?: string;
|
||||
sendInitialEvents?: boolean;
|
||||
timeoutSeconds?: number;
|
||||
watch?: boolean;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
interface UserInfo {
|
||||
username: string;
|
||||
is_admin: boolean;
|
||||
@@ -24,6 +61,7 @@ declare namespace Global {
|
||||
id: number;
|
||||
source: string;
|
||||
avatar_url: string;
|
||||
org_name?: string;
|
||||
}
|
||||
type EmptyObject = Record<never, never>;
|
||||
|
||||
|
||||
@@ -72,3 +72,16 @@ export const lengthReg = /^.{6,64}$/;
|
||||
*/
|
||||
export const modelNameReg =
|
||||
/^[A-Za-z0-9](?:[A-Za-z0-9._-]{0,61}[A-Za-z0-9])?$/g;
|
||||
|
||||
/**
|
||||
* Label name rules:
|
||||
* 1. no more than 63 characters
|
||||
* 2. contain only lowercase alphanumeric characters and '-'
|
||||
* 3. start and end with an alphanumeric character
|
||||
* 4. must not contain consecutive '-' characters
|
||||
* 5. must not start with a digit
|
||||
* 6. must not end with a '-'
|
||||
*/
|
||||
|
||||
export const validateLabelNameRegxFor63 =
|
||||
/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
|
||||
|
||||
Reference in New Issue
Block a user