Skip to content

Built for people who want to own their automations. Join the waitlist for an invite.

Package listing

@kody/bluesky

src/types.ts

110 lines · 2.2 KB · TypeScript
export type BlueskyServiceInput = {
  service?: string
  /** Session identifier; defaults to packageStorage blueskyHandle. */
  identifier?: string
}

export type BlueskyConfirmInput = {
  dryRun?: boolean
  confirm?: boolean
}

export type BlueskyRequestInput = BlueskyServiceInput &
  BlueskyConfirmInput & {
    nsid?: string
    method?: string
    query?: Record<string, unknown>
    body?: unknown
    authenticated?: boolean
  }

export type ResolveHandleInput = BlueskyServiceInput & {
  handle?: string
}

export type GetProfileInput = BlueskyServiceInput & {
  actor?: string
  authenticated?: boolean
}

export type SearchPostsInput = BlueskyServiceInput & {
  q?: string
  limit?: number
  sort?: string
  since?: string
  until?: string
  mentions?: string
  author?: string
  domain?: string
  url?: string
  cursor?: string
}

export type GetAuthorFeedInput = BlueskyServiceInput & {
  actor?: string
  limit?: number
  cursor?: string
  filter?: string
  authenticated?: boolean
}

export type GetPostThreadInput = BlueskyServiceInput & {
  uri?: string
  depth?: number
  parentHeight?: number
  authenticated?: boolean
}

export type ListNotificationsInput = BlueskyServiceInput & {
  limit?: number
  cursor?: string
  seenAt?: string
}

export type ExternalCardInput = {
  uri: string
  title: string
  description: string
  thumbnailUrl?: string
}

export type CreatePostInput = BlueskyServiceInput &
  BlueskyConfirmInput & {
    text?: string
    langs?: string[]
    facets?: unknown[]
    autoLinkFacets?: boolean
    reply?: unknown
    embed?: unknown
    externalCard?: ExternalCardInput
    createdAt?: string
    /** Session identifier; defaults to packageStorage blueskyHandle. */
    identifier?: string
  }

export type DeletePostInput = BlueskyServiceInput &
  BlueskyConfirmInput & {
    uri?: string
    repo?: string
    collection?: string
    rkey?: string
  }

export type LikeRepostInput = BlueskyServiceInput &
  BlueskyConfirmInput & {
    uri?: string
    cid?: string
    createdAt?: string
  }

export type FollowInput = BlueskyServiceInput &
  BlueskyConfirmInput & {
    actor?: string
    createdAt?: string
  }

export type UnfollowInput = BlueskyServiceInput &
  BlueskyConfirmInput & {
    uri?: string
    actor?: string
  }