Types
Files
FileObject
export type FileObject = {
name: string;
size: number;
type: string;
lastModified: number;
arrayBuffer: () => Promise<ArrayBuffer>;
};
JsonBody
export type JsonBody = Record<string, unknown>;
PinataMetadata
export type PinataMetadata = {
name?: string;
keyvalues?: Record<string, string>;
};
UpdateFileOptions
export type UpdateFileOptions = {
id: string;
name?: string;
keyvalues?: Record<string, string>;
};
DeleteResponse
export type DeleteResponse = {
id: string;
status: string;
};
FileListItem
export type FileListItem = {
id: string;
name: string | null;
cid: "pending" | string;
size: number;
number_of_files: number;
mime_type: string;
keyvalues: Record<string, string>;
group_id: string | null;
created_at: string;
};
FileListResponse
export type FileListResponse = {
files: FileListItem[];
next_page_token: string;
};
FileListQuery
export type FileListQuery = {
name?: string;
group?: string;
noGroup?: boolean;
mimeType?: string;
cid?: string;
cidPending?: boolean;
metadata?: Record<string, string>;
order?: "ASC" | "DESC";
limit?: number;
pageToken?: string;
};
PinQueueQuery
export type PinQueueQuery = {
sort?: "ASC" | "DSC";
status?:
| "prechecking"
| "retrieving"
| "expired"
| "over_free_limit"
| "over_max_size"
| "invalid_object"
| "bad_host_node";
ipfs_pin_hash?: string;
limit?: number;
pageToken?: string;
};
PinQueueItem
export type PinQueueItem = {
id: string;
cid?: string;
ipfs_pin_hash?: string;
date_queued: string;
name: string;
status: string;
keyvalues: any;
host_nodes: string[];
pin_policy: {
regions: {
id: string;
desiredReplicationCount: number;
}[];
version: number;
};
};
PinQueueResponse
export type PinQueueResponse = {
rows: PinQueueItem[];
next_page_token: string;
};
SwapCidOptions
export type SwapCidOptions = {
cid: string;
swapCid: string;
};
SwapHistoryOptions
export type SwapHistoryOptions = {
cid: string;
domain: string;
};
SwapCidResponse
export type SwapCidResponse = {
mapped_cid: string;
created_at: string;
};
VectorizeFileResponse
export type VectorizeFileResponse = {
status: boolean;
};
VectorizeQuery
export type VectorizeQuery = {
groupId: string;
query: string;
returnFile?: boolean;
};
VectorQueryMatch
export type VectorQueryMatch = {
file_id: string;
cid: string;
score: number;
};
VectorizeQueryResponse
export type VectorizeQueryResponse = {
count: number;
matches: VectorQueryMatch[];
};