@codesoul-co/hypha-core / contracts/artifact-store
- Package index:
@codesoul-co/hypha-core - Source:
packages/core/src/contracts/artifact-store.ts - Exports: 13
Using this module
Use the Artifact store module for declaring and runtime-validating contracts. It exports 12 interfaces, 1 type.
Import from the package entrypoint
import type {
ArtifactByteRange,
ArtifactContent,
ArtifactCopyRequest,
ArtifactDownloadAccess,
ArtifactDownloadAccessRequest,
ArtifactGetRequest,
ArtifactObjectMetadata,
ArtifactOperationOptions,
} from '@codesoul-co/hypha-core';
// The complete export list is documented below.Usage patterns
- Use the 13 type/interface exports as static contracts in application code, adapters, or tests. Import them with
import type; they do not exist at runtime.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
ArtifactByteRange | interface | interface ArtifactByteRange | Artifact Byte Range interface with 2 public fields or methods. |
ArtifactContent | interface | interface ArtifactContent | Artifact Content interface with 6 public fields or methods. |
ArtifactCopyRequest | interface | interface ArtifactCopyRequest | Artifact Copy Request interface with 4 public fields or methods. |
ArtifactDownloadAccess | interface | interface ArtifactDownloadAccess | Artifact Download Access interface with 4 public fields or methods. |
ArtifactDownloadAccessRequest | interface | interface ArtifactDownloadAccessRequest | Artifact Download Access Request interface with 4 public fields or methods. |
ArtifactGetRequest | interface | interface ArtifactGetRequest | Artifact Get Request interface with 3 public fields or methods. |
ArtifactObjectMetadata | interface | interface ArtifactObjectMetadata | Artifact Object Metadata interface with 6 public fields or methods. |
ArtifactOperationOptions | interface | interface ArtifactOperationOptions | Artifact Operation Options interface with 1 public fields or methods. |
ArtifactPutRequest | interface | interface ArtifactPutRequest | Artifact Put Request interface with 8 public fields or methods. |
ArtifactStoreCapabilities | interface | interface ArtifactStoreCapabilities | Artifact Store Capabilities interface with 7 public fields or methods. |
ArtifactStoreProvider | interface | interface ArtifactStoreProvider | Artifact Store Provider interface with 11 public fields or methods. |
ArtifactStoreProviderFactory | interface | interface ArtifactStoreProviderFactory | Artifact Store Provider Factory interface with 2 public fields or methods. |
ArtifactByteSource | type | type ArtifactByteSource = Uint8Array | AsyncIterable<Uint8Array> | Public type alias for Artifact Byte Source; the declaration contains its complete type expression. |
ArtifactByteRange
Artifact Byte Range interface with 2 public fields or methods.
- Kind: interface
- Import:
import type { ArtifactByteRange } from '@codesoul-co/hypha-core'; - Source module:
contracts/artifact-store
Declaration
export interface ArtifactByteRange {
start: number;
endInclusive?: number;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
endInclusive | property | endInclusive?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
start | property | start: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
ArtifactContent
Artifact Content interface with 6 public fields or methods.
- Kind: interface
- Import:
import type { ArtifactContent } from '@codesoul-co/hypha-core'; - Source module:
contracts/artifact-store
Declaration
export interface ArtifactContent {
stream: AsyncIterable<Uint8Array>;
contentHash: string;
sizeBytes: number;
mimeType?: string;
etag?: string;
range?: ArtifactByteRange;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
contentHash | property | contentHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
etag | property | etag?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
mimeType | property | mimeType?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
range | property | range?: ArtifactByteRange | Public property; its type, readonly modifier and optionality are shown in the signature. |
sizeBytes | property | sizeBytes: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
stream | property | stream: AsyncIterable<Uint8Array<ArrayBufferLike>> | Public property; its type, readonly modifier and optionality are shown in the signature. |
ArtifactCopyRequest
Artifact Copy Request interface with 4 public fields or methods.
- Kind: interface
- Import:
import type { ArtifactCopyRequest } from '@codesoul-co/hypha-core'; - Source module:
contracts/artifact-store
Declaration
export interface ArtifactCopyRequest {
operationId: string;
source: ArtifactStorageRef;
targetObjectKey: string;
ifAbsent?: boolean;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
ifAbsent | property | ifAbsent?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
operationId | property | operationId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
source | property | source: ArtifactStorageRef | Public property; its type, readonly modifier and optionality are shown in the signature. |
targetObjectKey | property | targetObjectKey: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
ArtifactDownloadAccess
Artifact Download Access interface with 4 public fields or methods.
- Kind: interface
- Import:
import type { ArtifactDownloadAccess } from '@codesoul-co/hypha-core'; - Source module:
contracts/artifact-store
Declaration
export interface ArtifactDownloadAccess {
method: 'GET';
url: string;
expiresAt: string;
headers?: Record<string, string>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
expiresAt | property | expiresAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
headers | property | headers?: Record<string, string> | Public property; its type, readonly modifier and optionality are shown in the signature. |
method | property | method: "GET" | Public property; its type, readonly modifier and optionality are shown in the signature. |
url | property | url: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
ArtifactDownloadAccessRequest
Artifact Download Access Request interface with 4 public fields or methods.
- Kind: interface
- Import:
import type { ArtifactDownloadAccessRequest } from '@codesoul-co/hypha-core'; - Source module:
contracts/artifact-store
Declaration
export interface ArtifactDownloadAccessRequest {
ref: ArtifactStorageRef;
expiresInSeconds: number;
responseMimeType?: string;
responseFilename?: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
expiresInSeconds | property | expiresInSeconds: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
ref | property | ref: ArtifactStorageRef | Public property; its type, readonly modifier and optionality are shown in the signature. |
responseFilename | property | responseFilename?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
responseMimeType | property | responseMimeType?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
ArtifactGetRequest
Artifact Get Request interface with 3 public fields or methods.
- Kind: interface
- Import:
import type { ArtifactGetRequest } from '@codesoul-co/hypha-core'; - Source module:
contracts/artifact-store
Declaration
export interface ArtifactGetRequest {
ref: ArtifactStorageRef;
range?: ArtifactByteRange;
expectedContentHash?: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
expectedContentHash | property | expectedContentHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
range | property | range?: ArtifactByteRange | Public property; its type, readonly modifier and optionality are shown in the signature. |
ref | property | ref: ArtifactStorageRef | Public property; its type, readonly modifier and optionality are shown in the signature. |
ArtifactObjectMetadata
Artifact Object Metadata interface with 6 public fields or methods.
- Kind: interface
- Import:
import type { ArtifactObjectMetadata } from '@codesoul-co/hypha-core'; - Source module:
contracts/artifact-store
Declaration
export interface ArtifactObjectMetadata {
contentHash: string;
sizeBytes: number;
mimeType?: string;
etag?: string;
lastModifiedAt?: string;
metadata?: Record<string, string>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
contentHash | property | contentHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
etag | property | etag?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
lastModifiedAt | property | lastModifiedAt?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
metadata | property | metadata?: Record<string, string> | Public property; its type, readonly modifier and optionality are shown in the signature. |
mimeType | property | mimeType?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
sizeBytes | property | sizeBytes: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
ArtifactOperationOptions
Artifact Operation Options interface with 1 public fields or methods.
- Kind: interface
- Import:
import type { ArtifactOperationOptions } from '@codesoul-co/hypha-core'; - Source module:
contracts/artifact-store
Declaration
export interface ArtifactOperationOptions {
abortSignal?: AbortSignal;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
abortSignal | property | abortSignal?: AbortSignal | Public property; its type, readonly modifier and optionality are shown in the signature. |
ArtifactPutRequest
Artifact Put Request interface with 8 public fields or methods.
- Kind: interface
- Import:
import type { ArtifactPutRequest } from '@codesoul-co/hypha-core'; - Source module:
contracts/artifact-store
Declaration
export interface ArtifactPutRequest {
operationId: string;
objectKey: string;
content: ArtifactByteSource;
expectedContentHash?: string;
sizeBytes?: number;
mimeType?: string;
metadata?: Record<string, string>;
ifAbsent?: boolean;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
content | property | content: ArtifactByteSource | Public property; its type, readonly modifier and optionality are shown in the signature. |
expectedContentHash | property | expectedContentHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
ifAbsent | property | ifAbsent?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
metadata | property | metadata?: Record<string, string> | Public property; its type, readonly modifier and optionality are shown in the signature. |
mimeType | property | mimeType?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
objectKey | property | objectKey: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
operationId | property | operationId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
sizeBytes | property | sizeBytes?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
ArtifactStoreCapabilities
Artifact Store Capabilities interface with 7 public fields or methods.
- Kind: interface
- Import:
import type { ArtifactStoreCapabilities } from '@codesoul-co/hypha-core'; - Source module:
contracts/artifact-store
Declaration
export interface ArtifactStoreCapabilities {
versioning: boolean;
rangeRead: boolean;
signedAccess: boolean;
serverSideCopy: boolean;
encryption: boolean;
multipartUpload: boolean;
contentAddressing: boolean;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
contentAddressing | property | contentAddressing: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
encryption | property | encryption: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
multipartUpload | property | multipartUpload: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
rangeRead | property | rangeRead: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
serverSideCopy | property | serverSideCopy: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
signedAccess | property | signedAccess: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
versioning | property | versioning: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
ArtifactStoreProvider
Artifact Store Provider interface with 11 public fields or methods.
- Kind: interface
- Import:
import type { ArtifactStoreProvider } from '@codesoul-co/hypha-core'; - Source module:
contracts/artifact-store
Declaration
export interface ArtifactStoreProvider {
readonly id: string;
capabilities(): Promise<ArtifactStoreCapabilities>;
put(request: ArtifactPutRequest, options?: ArtifactOperationOptions): Promise<ArtifactStorageRef>;
get(request: ArtifactGetRequest, options?: ArtifactOperationOptions): Promise<ArtifactContent>;
head(ref: ArtifactStorageRef): Promise<ArtifactObjectMetadata | null>;
exists(ref: ArtifactStorageRef): Promise<boolean>;
delete(ref: ArtifactStorageRef): Promise<void>;
copy(request: ArtifactCopyRequest): Promise<ArtifactStorageRef>;
createDownloadAccess?(request: ArtifactDownloadAccessRequest): Promise<ArtifactDownloadAccess>;
health(): Promise<ProviderHealth>;
close?(): Promise<void>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
capabilities | method | capabilities(): Promise<ArtifactStoreCapabilities> | Public method; parameters and return type are shown in the signature. |
close | method | close?(): Promise<void> | Public method; parameters and return type are shown in the signature. |
copy | method | copy(request: ArtifactCopyRequest): Promise<ArtifactStorageRef> | Public method; parameters and return type are shown in the signature. |
createDownloadAccess | method | createDownloadAccess?(request: ArtifactDownloadAccessRequest): Promise<ArtifactDownloadAccess> | Public method; parameters and return type are shown in the signature. |
delete | method | delete(ref: ArtifactStorageRef): Promise<void> | Public method; parameters and return type are shown in the signature. |
exists | method | exists(ref: ArtifactStorageRef): Promise<boolean> | Public method; parameters and return type are shown in the signature. |
get | method | get(request: ArtifactGetRequest, options?: ArtifactOperationOptions): Promise<ArtifactContent> | Public method; parameters and return type are shown in the signature. |
head | method | head(ref: ArtifactStorageRef): Promise<ArtifactObjectMetadata | null> | Public method; parameters and return type are shown in the signature. |
health | method | health(): Promise<ProviderHealth> | Public method; parameters and return type are shown in the signature. |
id | property | readonly id: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
put | method | put(request: ArtifactPutRequest, options?: ArtifactOperationOptions): Promise<ArtifactStorageRef> | Public method; parameters and return type are shown in the signature. |
ArtifactStoreProviderFactory
Artifact Store Provider Factory interface with 2 public fields or methods.
- Kind: interface
- Import:
import type { ArtifactStoreProviderFactory } from '@codesoul-co/hypha-core'; - Source module:
contracts/artifact-store
Declaration
export interface ArtifactStoreProviderFactory {
readonly providerId: string;
create(): ArtifactStoreProvider | Promise<ArtifactStoreProvider>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
create | method | create(): ArtifactStoreProvider | Promise<ArtifactStoreProvider> | Public method; parameters and return type are shown in the signature. |
providerId | property | readonly providerId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
ArtifactByteSource
Public type alias for Artifact Byte Source; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { ArtifactByteSource } from '@codesoul-co/hypha-core'; - Source module:
contracts/artifact-store
Declaration
export type ArtifactByteSource = Uint8Array | AsyncIterable<Uint8Array>;