Refactor StoredObject normalization handling

Deprecate and remove specific context constants from StoredObjectNormalizer. Update object properties for better clarity and add permissions handling. Introduce related tests and adjust other files relying on the old context constants.
This commit is contained in:
2024-08-28 23:19:24 +02:00
parent 00cc3b7806
commit b6edbb3eed
7 changed files with 211 additions and 29 deletions

View File

@@ -1,28 +1,44 @@
import {DateTime} from "../../../ChillMainBundle/Resources/public/types";
import {DateTime, User} from "../../../ChillMainBundle/Resources/public/types";
export type StoredObjectStatus = "empty"|"ready"|"failure"|"pending";
export interface StoredObject {
id: number,
/**
* filename of the object in the object storage
*/
filename: string,
creationDate: DateTime,
datas: object,
iv: number[],
keyInfos: object,
title: string,
type: string,
uuid: string,
prefix: string,
status: StoredObjectStatus,
currentVersion: null|StoredObjectVersion,
totalVersions: number,
datas: object,
/** @deprecated */
creationDate: DateTime,
createdAt: DateTime|null,
createdBy: User|null,
_permissions: {
canEdit: boolean,
canSee: boolean,
},
_links?: {
dav_link?: {
href: string
expiration: number
},
}
},
}
export interface StoredObjectVersion {
/**
* filename of the object in the object storage
*/
filename: string,
version: number,
id: number,
iv: number[],
keyInfos: object,
type: string,
createdAt: DateTime|null,
createdBy: User|null,
}
export interface StoredObjectCreated {