2024-06-07 20:17:03 +03:00
|
|
|
/**
|
|
|
|
* Module: Models for LibraryItem.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents type of library items.
|
|
|
|
*/
|
|
|
|
export enum LibraryItemType {
|
|
|
|
RSFORM = 'rsform',
|
|
|
|
OSS = 'oss'
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents Access policy for library items.
|
|
|
|
*/
|
|
|
|
export enum AccessPolicy {
|
|
|
|
PUBLIC = 'public',
|
|
|
|
PROTECTED = 'protected',
|
|
|
|
PRIVATE = 'private'
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents valid location headers.
|
|
|
|
*/
|
|
|
|
export enum LocationHead {
|
|
|
|
USER = '/U',
|
|
|
|
COMMON = '/S',
|
2024-06-19 22:09:31 +03:00
|
|
|
PROJECTS = '/P',
|
|
|
|
LIBRARY = '/L'
|
2024-06-07 20:17:03 +03:00
|
|
|
}
|
|
|
|
|
2024-09-12 13:27:06 +03:00
|
|
|
export const BASIC_SCHEMAS = '/L/Базовые';
|
|
|
|
|
2024-06-07 20:17:03 +03:00
|
|
|
/**
|
|
|
|
* Represents library item version information.
|
|
|
|
*/
|
|
|
|
export interface IVersionInfo {
|
2025-02-12 20:53:01 +03:00
|
|
|
id: number;
|
|
|
|
item: number;
|
2024-06-07 20:17:03 +03:00
|
|
|
version: string;
|
|
|
|
description: string;
|
|
|
|
time_create: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents library item common data typical for all item types.
|
|
|
|
*/
|
|
|
|
export interface ILibraryItem {
|
2025-02-12 20:53:01 +03:00
|
|
|
id: number;
|
2024-06-07 20:17:03 +03:00
|
|
|
item_type: LibraryItemType;
|
|
|
|
title: string;
|
|
|
|
alias: string;
|
|
|
|
comment: string;
|
|
|
|
visible: boolean;
|
|
|
|
read_only: boolean;
|
|
|
|
location: string;
|
|
|
|
access_policy: AccessPolicy;
|
|
|
|
time_create: string;
|
|
|
|
time_update: string;
|
2025-02-12 13:07:26 +03:00
|
|
|
owner: number | null;
|
2024-06-07 20:17:03 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-08-01 00:35:49 +03:00
|
|
|
* Represents {@link ILibraryItem} constant data loaded for both OSS and RSForm.
|
2024-06-07 20:17:03 +03:00
|
|
|
*/
|
|
|
|
export interface ILibraryItemData extends ILibraryItem {
|
2025-02-12 13:07:26 +03:00
|
|
|
editors: number[];
|
2024-06-07 20:17:03 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-08-01 00:35:49 +03:00
|
|
|
* Represents {@link ILibraryItem} minimal reference data.
|
|
|
|
*/
|
|
|
|
export interface ILibraryItemReference extends Pick<ILibraryItem, 'id' | 'alias'> {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents {@link ILibraryItem} extended data with versions.
|
2024-06-07 20:17:03 +03:00
|
|
|
*/
|
|
|
|
export interface ILibraryItemVersioned extends ILibraryItemData {
|
2025-02-12 20:53:01 +03:00
|
|
|
version?: number;
|
2024-06-07 20:17:03 +03:00
|
|
|
versions: IVersionInfo[];
|
|
|
|
}
|
|
|
|
|
2025-02-10 01:32:16 +03:00
|
|
|
/**
|
|
|
|
* Represents Library filter parameters.
|
|
|
|
*/
|
|
|
|
export interface ILibraryFilter {
|
|
|
|
type?: LibraryItemType;
|
|
|
|
query?: string;
|
|
|
|
|
|
|
|
folderMode?: boolean;
|
|
|
|
subfolders?: boolean;
|
|
|
|
path?: string;
|
|
|
|
head?: LocationHead;
|
|
|
|
location?: string;
|
|
|
|
|
|
|
|
isVisible?: boolean;
|
|
|
|
isOwned?: boolean;
|
|
|
|
isEditor?: boolean;
|
2025-02-12 13:07:26 +03:00
|
|
|
filterUser?: number;
|
2025-02-10 01:32:16 +03:00
|
|
|
}
|