synapse-react-client
Version:
[](https://travis-ci.com/Sage-Bionetworks/Synapse-React-Client) [](https://badge.fury.io/js/synaps
74 lines (73 loc) • 3.81 kB
TypeScript
import { AttachmentData } from '../AttachmentData';
import { TABLE_CONCRETE_TYPE } from '../Table/Table';
import { FILE_ENTITY_CONCRETE_TYPE } from './FileEntity';
export interface Entity {
/** The name of this entity? */
name: string;
/** The description of this entity. */
description?: string;
/** The unique immutable ID for this entity. A new ID will be generated for new Entities. Once issued, this ID is guaranteed to never change or be re-issued */
readonly id?: string;
/** Synapse employs an Optimistic Concurrency Control (OCC) scheme to handle concurrent updates. Since the E-Tag changes every time an entity is updated it is used to detect when a client's current representation of an entity is out-of-date. */
readonly etag?: string;
/** The date this entity was created. */
readonly createdOn?: string;
/** The date this entity was last modified. */
readonly modifiedOn?: string;
/** The ID of the user that created this entity. */
readonly createdBy?: string;
/** The ID of the user that last modified this entity. */
readonly modifiedBy?: string;
/** The ID of the Entity that is the parent of this Entity. */
parentId?: string;
/** Indicates which implementation of Entity this object represents. */
readonly concreteType: ENTITY_CONCRETE_TYPE;
/** @deprecated This field is deprecated and will be removed in future versions of Synapse */
attachments?: AttachmentData[];
/** @deprecated This field is deprecated and will be removed in future versions of Synapse */
annotations?: string;
/** @deprecated This field is deprecated and will be removed in future versions of Synapse */
accessControlList?: string;
/** @deprecated This field is deprecated and will be removed in future versions of Synapse */
entityType?: string;
/** @deprecated This field is deprecated and will be removed in future versions of Synapse */
uri?: string;
}
declare type LINK_CONCRETE_TYPE = 'org.sagebionetworks.repo.model.Link';
declare type DOCKER_REPOSITORY_CONCRETE_TYPE = 'org.sagebionetworks.repo.model.docker.DockerRepository';
declare type FOLDER_CONCRETE_TYPE = 'org.sagebionetworks.repo.model.Folder';
declare type PROJECT_CONCRETE_TYPE = 'org.sagebionetworks.repo.model.Project';
export declare type ENTITY_CONCRETE_TYPE = LINK_CONCRETE_TYPE | DOCKER_REPOSITORY_CONCRETE_TYPE | VERSIONABLE_ENTITY_CONCRETE_TYPE | FOLDER_CONCRETE_TYPE | PROJECT_CONCRETE_TYPE;
export interface Versionable {
versionNumber?: number;
}
declare type VERSIONABLE_ENTITY_CONCRETE_TYPE = FILE_ENTITY_CONCRETE_TYPE | TABLE_CONCRETE_TYPE;
export interface VersionableEntity extends Entity, Versionable {
versionLabel?: string;
versionComment?: string;
isLatestVersion?: boolean;
concreteType: VERSIONABLE_ENTITY_CONCRETE_TYPE;
}
export declare type EntityJsonValue = string | number | boolean | string[] | number[] | boolean[] | undefined;
export interface EntityJson extends Record<string, EntityJsonValue> {
name: string;
id: string;
etag: string;
createdOn: string;
modifiedOn: string;
createdBy: string;
modifiedBy: string;
parentId: string;
concreteType: ENTITY_CONCRETE_TYPE;
versionNumber?: number;
versionLabel?: string;
isLatestVersion?: boolean;
dataFileHandleId?: string;
}
/**
* A string array of all possible keys used by Synapse in Entity objects (objects that inherit this interface: https://docs.synapse.org/rest/org/sagebionetworks/repo/model/Entity.html).
* This object is used to determine which fields are standard and which are annotations,
* so it's important that this array contains all keys in the objects that implement the linked interface above.
*/
export declare const entityJsonKeys: string[];
export {};