projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
14813: wb2 uses cluster config
[arvados.git]
/
src
/
models
/
resource.ts
diff --git
a/src/models/resource.ts
b/src/models/resource.ts
index 6f82402821ec26fc9c8cc5ea94876df6dfa4c508..239a67cc1251e88d6b6968c89a7d9b878ac9b214 100644
(file)
--- a/
src/models/resource.ts
+++ b/
src/models/resource.ts
@@
-2,8
+2,6
@@
//
// SPDX-License-Identifier: AGPL-3.0
//
// SPDX-License-Identifier: AGPL-3.0
-import { ApiClientAuthorization } from '~/models/api-client-authorization';
-
export interface Resource {
uuid: string;
ownerUuid: string;
export interface Resource {
uuid: string;
ownerUuid: string;
@@
-16,8
+14,6
@@
export interface Resource {
etag: string;
}
etag: string;
}
-export type ResourceTypes = Resource | ApiClientAuthorization;
-
export interface TrashableResource extends Resource {
trashAt: string;
deleteAt: string;
export interface TrashableResource extends Resource {
trashAt: string;
deleteAt: string;
@@
-61,8
+57,9
@@
export enum ResourceObjectType {
NODE = '7ekkf'
}
NODE = '7ekkf'
}
-export const RESOURCE_UUID_PATTERN = '
.{5}-.{5}-.
{15}';
+export const RESOURCE_UUID_PATTERN = '
[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]
{15}';
export const RESOURCE_UUID_REGEX = new RegExp(RESOURCE_UUID_PATTERN);
export const RESOURCE_UUID_REGEX = new RegExp(RESOURCE_UUID_PATTERN);
+export const COLLECTION_PDH_REGEX = /[a-f0-9]{32}\+\d+/;
export const isResourceUuid = (uuid: string) =>
RESOURCE_UUID_REGEX.test(uuid);
export const isResourceUuid = (uuid: string) =>
RESOURCE_UUID_REGEX.test(uuid);
@@
-106,6
+103,7
@@
export const extractUuidKind = (uuid: string = '') => {
case ResourceObjectType.LINK:
return ResourceKind.LINK;
default:
case ResourceObjectType.LINK:
return ResourceKind.LINK;
default:
- return undefined;
+ const match = COLLECTION_PDH_REGEX.exec(uuid);
+ return match ? ResourceKind.COLLECTION : undefined;
}
};
}
};