AuthTestResponse

type AuthTestResponse = {
  message: string;
};

ContainsCIDResponse

type ContainsCIDResponse = {
  containsCid: boolean;
  cid: string | null;
};

ContentType

type ContentType =
  | "application/json"
  | "application/xml"
  | "text/plain"
  | "text/html"
  | "text/css"
  | "text/javascript"
  | "application/javascript"
  | "image/jpeg"
  | "image/png"
  | "image/gif"
  | "image/svg+xml"
  | "audio/mpeg"
  | "audio/ogg"
  | "video/mp4"
  | "application/pdf"
  | "application/octet-stream"
  | string
  | null;

DataEndpoints

type DataEndpoints = {
  pinList?: boolean;
  userPinnedDataTotal?: boolean;
};

DeleteResponse

type DeleteResponse = {
  id: string;
  status: string;
};

Endpoints

type Endpoints = {
  data?: DataEndpoints;
  pinning?: PinningEndpoints;
};

FileListItem

type FileListItem = {
  id: string;
  name: string | null;
  cid: "pending" | string;
  size: number;
  number_of_files: number;
  mime_type: string;
  group_id: string | null;
  created_at: string;
};

FileListQuery

type FileListQuery = {
  limit?: number;
  pageToken?: string;
  cidPending?: boolean;
};

FileListResponse

type FileListResponse = {
  files: FileListItem[];
  next_page_token: string;
};

FileObject

type FileObject = {
  name: string;
  size: number;
  type: string;
  lastModified: number;
  arrayBuffer: () => Promise<ArrayBuffer>;
};

GatewayAnalyticsQuery

type GatewayAnalyticsQuery = {
  gateway_domain: string;
  start_date: string;
  end_date: string;
  cid?: string;
  file_name?: string;
  user_agent?: string;
  country?: string;
  region?: string;
  referer?: string;
  limit?: number;
  sort_order?: "asc" | "desc";
};

GetCIDResponse

type GetCIDResponse = {
  data?: JSON | string | Blob | null;
  contentType: ContentType;
};

GetGroupOptions

type GetGroupOptions = {
  groupId: string;
};

GroupCIDOptions

type GroupCIDOptions = {
  groupId: string;
  cids: string[];
};

GroupListResponse

type GroupListResponse = {
  groups: GroupResponseItem[];
  next_page_token: string;
};

GroupOptions

type GroupOptions = {
  name: string;
  isPublic?: boolean;
};

GroupQueryOptions

type GroupQueryOptions = {
  nameContains?: string;
  limit?: number;
  pageToken?: string;
  isPublic?: boolean;
};

GroupResponseItem

type GroupResponseItem = {
  id: string;
  is_public: boolean;
  name: string;
  createdAt: string;
};

JsonBody

type JsonBody = Record<string, unknown>;

KeyListItem

type KeyListItem = {
  id: string;
  name: string;
  key: string;
  secret: string;
  max_uses: number;
  uses: number;
  user_id: string;
  scopes: KeyScopes;
  revoked: boolean;
  createdAt: string;
  updatedAt: string;
};

KeyListQuery

type KeyListQuery = {
  revoked?: boolean;
  limitedUse?: boolean;
  exhausted?: boolean;
  name?: string;
  offset?: number;
};

KeyListResponse

type KeyListResponse = {
  keys: KeyListItem[];
  count: number;
};

KeyOptions

type KeyOptions = {
  keyName: string;
  permissions: KeyPermissions;
  maxUses?: number;
};

KeyPermissions

type KeyPermissions = {
  admin?: boolean;
  endpoints?: Endpoints;
};

KeyResponse

type KeyResponse = {
  JWT: string;
  pinata_api_key: string;
  pinata_api_secret: string;
};

KeyScopes

type KeyScopes = {
  endpoints: {
    pinning: {
      pinFileToIPFS: boolean;
      pinJSONToIPFS: boolean;
    };
  };
  admin: boolean;
};

OptimizeImageOptions

type OptimizeImageOptions = {
  width?: number;
  height?: number;
  dpr?: number;
  fit?: "scaleDown" | "contain" | "cover" | "crop" | "pad";
  gravity?: "auto" | "side" | string;
  quality?: number;
  format?: "auto" | "webp";
  animation?: boolean;
  sharpen?: number;
  onError?: boolean;
  metadata?: "keep" | "copyright" | "none";
};

PinataConfig

type PinataConfig = {
  pinataJwt: string | undefined;
  pinataGateway?: string;
  pinataGatewayKey?: string;
  customHeaders?: Record<string, string>;
  endpointUrl?: string;
  uploadUrl?: string;
};

PinataMetadata

type PinataMetadata = {
  name?: string;
  keyvalues: Record<string, string>;
};

PinningEndpoints

type PinningEndpoints = {
  hashMetadata?: boolean;
  hashPinPolicy?: boolean;
  pinByHash?: boolean;
  pinFileToIPFS?: boolean;
  pinJSONToIPFS?: boolean;
  pinJobs?: boolean;
  unpin?: boolean;
  userPinPolicy?: boolean;
};

RevokeKeyResponse

type RevokeKeyResponse = {
  key: string;
  status: string;
};

SignatureOptions

type SignatureOptions = {
  cid: string;
  signature: string;
};

SignatureResponse

type SignatureResponse = {
  cid: string;
  signature: string;
};

SignedUrlOptions

type SignedUrlOptions = {
  cid: string;
  date?: number;
  expires: number;
};

SwapCidOptions

type SwapCidOptions = {
  cid: string;
  swapCid: string;
};

SwapCidResponse

type SwapCidResponse = {
  mappedCid: string;
  createdAt: string;
};

SwapHistoryOptions

type SwapHistoryOptions = {
  cid: string;
  domain: string;
};

TimeIntervalGatewayAnalyticsQuery

type TimeIntervalGatewayAnalyticsQuery = GatewayAnalyticsQuery & {
  sort_by?: "requests" | "bandwidth";
  date_interval: "day" | "week";
};

TimeIntervalGatewayAnalyticsResponse

type TimeIntervalGatewayAnalyticsResponse = {
  total_requests: number;
  total_bandwidth: number;
  time_periods: TimePeriodItem[];
};

TimePeriodItem

type TimePeriodItem = {
  period_start_time: string;
  requests: number;
  bandwidth: number;
};

TopGatewayAnalyticsItem

type TopGatewayAnalyticsItem = {
  value: string;
  requests: number;
  bandwidth: number;
};

TopGatewayAnalyticsQuery

type TopGatewayAnalyticsQuery = GatewayAnalyticsQuery & {
  sort_by: "requests" | "bandwidth";
  attribute:
    | "cid"
    | "country"
    | "region"
    | "user_agent"
    | "referer"
    | "file_name";
};

UpdateFileOptions

type UpdateFileOptions = {
  id: string;
  name?: string;
};

UpdateGroupOptions

type UpdateGroupOptions = {
  groupId: string;
  name?: string;
  isPublic?: boolean;
};

UploadOptions

type UploadOptions = {
  metadata?: PinataMetadata;
  keys?: string;
  groupId?: string;
};

UploadResponse

type UploadResponse = {
  id: string;
  name: string;
  cid: string;
  size: number;
  created_at: string;
  number_of_files: number;
  mime_type: string;
  user_id: string;
  group_id: string | null;
  is_duplicate: boolean | null;
};

UserPinnedDataResponse

type UserPinnedDataResponse = {
  pin_count: number;
  pin_size_total: number;
  pin_size_with_replications_total: number;
};