dcl-catalyst-commons
Version:
Common tools and types to share between catalyst servers and clients
119 lines (118 loc) • 3.43 kB
TypeScript
import { AuthChain, EntityType, EthAddress } from '@dcl/schemas';
/** @deprecated */
export declare type ContentFileHash = string;
/** @deprecated */
export declare type Timestamp = number;
/** @deprecated */
export declare type EntityId = ContentFileHash;
/** @deprecated */
export declare type Pointer = string;
/** @deprecated */
export declare type EntityMetadata = any;
export declare type EntityContentItemReference = {
file: string;
hash: ContentFileHash;
};
export { EntityType } from '@dcl/schemas';
/** @deprecated use the type from @dcl/schemas */
export declare type Entity = {
version: EntityVersion;
id: EntityId;
type: EntityType;
pointers: Pointer[];
timestamp: Timestamp;
content?: EntityContentItemReference[];
metadata?: EntityMetadata;
};
/** @deprecated use the type from @dcl/schemas */
export declare type ServerName = string;
/** @deprecated use the type from @dcl/schemas */
export declare type ServerAddress = string;
/** @deprecated use the type from @dcl/schemas */
export declare type ServerStatus = {
name: ServerName;
version: EntityVersion;
currentTime: Timestamp;
lastImmutableTime: Timestamp;
historySize: number;
};
/** @deprecated use the type from @dcl/schemas */
export declare enum EntityVersion {
V2 = "v2",
V3 = "v3",
V4 = "v4"
}
export declare type AvailableContentResult = {
cid: ContentFileHash;
available: boolean;
}[];
export declare type PartialDeploymentHistory<T extends DeploymentBase> = {
deployments: T[];
filters: DeploymentFilters;
pagination: {
offset: number;
limit: number;
moreData: boolean;
next?: string;
lastId?: string;
};
};
export declare type DeploymentFilters = {
from?: Timestamp;
to?: Timestamp;
deployedBy?: EthAddress[];
entityTypes?: EntityType[];
entityIds?: EntityId[];
pointers?: Pointer[];
onlyCurrentlyPointed?: boolean;
};
export declare type DeploymentSorting = {
field?: SortingField;
order?: SortingOrder;
};
export declare enum SortingField {
LOCAL_TIMESTAMP = "local_timestamp",
ENTITY_TIMESTAMP = "entity_timestamp"
}
export declare enum SortingOrder {
ASCENDING = "ASC",
DESCENDING = "DESC"
}
export declare type Deployment = DeploymentBase & DeploymentWithPointers & DeploymentWithContent & DeploymentWithMetadata & DeploymentWithAuditInfo;
export declare type DeploymentBase = {
entityVersion: EntityVersion;
entityType: EntityType;
entityId: EntityId;
entityTimestamp: Timestamp;
deployedBy: EthAddress;
};
export declare type DeploymentWithPointers = DeploymentBase & {
pointers: Pointer[];
};
export declare type DeploymentWithContent = DeploymentBase & {
content?: DeploymentContent[];
};
export declare type DeploymentWithMetadata = DeploymentBase & {
metadata?: any;
};
export declare type DeploymentWithAuditInfo = DeploymentBase & {
auditInfo: AuditInfo;
};
export declare type DeploymentContent = {
key: string;
hash: string;
};
export declare type AuditInfo = {
version: EntityVersion;
authChain: AuthChain;
localTimestamp: Timestamp;
overwrittenBy?: EntityId;
isDenylisted?: boolean;
denylistedContent?: ContentFileHash[];
};
export declare type Profile = EntityMetadata;
export declare enum HealthStatus {
HEALTHY = "Healthy",
UNHEALTHY = "Unhealthy",
DOWN = "Down"
}