Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@atproto/api

Package Overview
Dependencies
Maintainers
4
Versions
163
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@atproto/api - npm Package Compare versions

Comparing version 0.5.4 to 0.5.5

tests/moderation.test.ts

69

dist/agent.d.ts

@@ -1,27 +0,46 @@

import { AtpServiceClient, ComAtprotoServerCreateAccount, ComAtprotoServerCreateSession, ComAtprotoServerGetSession } from './client';
import { AtpSessionData, AtpAgentCreateAccountOpts, AtpAgentLoginOpts, AtpAgentFetchHandler, AtpAgentGlobalOpts, AtpPersistSessionHandler, AtpAgentOpts } from './types';
import {
AtpServiceClient,
ComAtprotoServerCreateAccount,
ComAtprotoServerCreateSession,
ComAtprotoServerGetSession,
} from './client'
import {
AtpSessionData,
AtpAgentCreateAccountOpts,
AtpAgentLoginOpts,
AtpAgentFetchHandler,
AtpAgentGlobalOpts,
AtpPersistSessionHandler,
AtpAgentOpts,
} from './types'
export declare class AtpAgent {
service: URL;
api: AtpServiceClient;
session?: AtpSessionData;
private _baseClient;
private _persistSession?;
private _refreshSessionPromise;
get com(): import("./client").ComNS;
static fetch: AtpAgentFetchHandler | undefined;
static configure(opts: AtpAgentGlobalOpts): void;
constructor(opts: AtpAgentOpts);
get hasSession(): boolean;
setPersistSessionHandler(handler?: AtpPersistSessionHandler): void;
createAccount(opts: AtpAgentCreateAccountOpts): Promise<ComAtprotoServerCreateAccount.Response>;
login(opts: AtpAgentLoginOpts): Promise<ComAtprotoServerCreateSession.Response>;
resumeSession(session: AtpSessionData): Promise<ComAtprotoServerGetSession.Response>;
private _addAuthHeader;
private _fetch;
private _refreshSession;
private _refreshSessionInner;
uploadBlob: typeof this.api.com.atproto.repo.uploadBlob;
resolveHandle: typeof this.api.com.atproto.identity.resolveHandle;
updateHandle: typeof this.api.com.atproto.identity.updateHandle;
createModerationReport: typeof this.api.com.atproto.moderation.createReport;
service: URL
api: AtpServiceClient
session?: AtpSessionData
private _baseClient
private _persistSession?
private _refreshSessionPromise
get com(): import('./client').ComNS
static fetch: AtpAgentFetchHandler | undefined
static configure(opts: AtpAgentGlobalOpts): void
constructor(opts: AtpAgentOpts)
get hasSession(): boolean
setPersistSessionHandler(handler?: AtpPersistSessionHandler): void
createAccount(
opts: AtpAgentCreateAccountOpts,
): Promise<ComAtprotoServerCreateAccount.Response>
login(
opts: AtpAgentLoginOpts,
): Promise<ComAtprotoServerCreateSession.Response>
resumeSession(
session: AtpSessionData,
): Promise<ComAtprotoServerGetSession.Response>
private _addAuthHeader
private _fetch
private _refreshSession
private _refreshSessionInner
uploadBlob: typeof this.api.com.atproto.repo.uploadBlob
resolveHandle: typeof this.api.com.atproto.identity.resolveHandle
updateHandle: typeof this.api.com.atproto.identity.updateHandle
createModerationReport: typeof this.api.com.atproto.moderation.createReport
}

@@ -1,45 +0,64 @@

import { AtpAgent } from './agent';
import { AppBskyFeedPost, AppBskyActorProfile } from './client';
import { AtpAgent } from './agent'
import { AppBskyFeedPost, AppBskyActorProfile } from './client'
export declare class BskyAgent extends AtpAgent {
get app(): import("./client").AppNS;
getTimeline: typeof this.api.app.bsky.feed.getTimeline;
getAuthorFeed: typeof this.api.app.bsky.feed.getAuthorFeed;
getPostThread: typeof this.api.app.bsky.feed.getPostThread;
getPost: typeof this.api.app.bsky.feed.post.get;
getPosts: typeof this.api.app.bsky.feed.getPosts;
getLikes: typeof this.api.app.bsky.feed.getLikes;
getRepostedBy: typeof this.api.app.bsky.feed.getRepostedBy;
getFollows: typeof this.api.app.bsky.graph.getFollows;
getFollowers: typeof this.api.app.bsky.graph.getFollowers;
getProfile: typeof this.api.app.bsky.actor.getProfile;
getProfiles: typeof this.api.app.bsky.actor.getProfiles;
getSuggestions: typeof this.api.app.bsky.actor.getSuggestions;
searchActors: typeof this.api.app.bsky.actor.searchActors;
searchActorsTypeahead: typeof this.api.app.bsky.actor.searchActorsTypeahead;
listNotifications: typeof this.api.app.bsky.notification.listNotifications;
countUnreadNotifications: typeof this.api.app.bsky.notification.getUnreadCount;
post(record: Partial<AppBskyFeedPost.Record> & Omit<AppBskyFeedPost.Record, 'createdAt'>): Promise<{
uri: string;
cid: string;
}>;
deletePost(postUri: string): Promise<void>;
like(uri: string, cid: string): Promise<{
uri: string;
cid: string;
}>;
deleteLike(likeUri: string): Promise<void>;
repost(uri: string, cid: string): Promise<{
uri: string;
cid: string;
}>;
deleteRepost(repostUri: string): Promise<void>;
follow(subjectDid: string): Promise<{
uri: string;
cid: string;
}>;
deleteFollow(followUri: string): Promise<void>;
upsertProfile(updateFn: (existing: AppBskyActorProfile.Record | undefined) => AppBskyActorProfile.Record | Promise<AppBskyActorProfile.Record>): Promise<void>;
mute(actor: string): Promise<import("./client/types/app/bsky/graph/muteActor").Response>;
unmute(actor: string): Promise<import("./client/types/app/bsky/graph/unmuteActor").Response>;
updateSeenNotifications(seenAt?: string): Promise<import("./client/types/app/bsky/notification/updateSeen").Response>;
get app(): import('./client').AppNS
getTimeline: typeof this.api.app.bsky.feed.getTimeline
getAuthorFeed: typeof this.api.app.bsky.feed.getAuthorFeed
getPostThread: typeof this.api.app.bsky.feed.getPostThread
getPost: typeof this.api.app.bsky.feed.post.get
getPosts: typeof this.api.app.bsky.feed.getPosts
getLikes: typeof this.api.app.bsky.feed.getLikes
getRepostedBy: typeof this.api.app.bsky.feed.getRepostedBy
getFollows: typeof this.api.app.bsky.graph.getFollows
getFollowers: typeof this.api.app.bsky.graph.getFollowers
getProfile: typeof this.api.app.bsky.actor.getProfile
getProfiles: typeof this.api.app.bsky.actor.getProfiles
getSuggestions: typeof this.api.app.bsky.actor.getSuggestions
searchActors: typeof this.api.app.bsky.actor.searchActors
searchActorsTypeahead: typeof this.api.app.bsky.actor.searchActorsTypeahead
listNotifications: typeof this.api.app.bsky.notification.listNotifications
countUnreadNotifications: typeof this.api.app.bsky.notification.getUnreadCount
post(
record: Partial<AppBskyFeedPost.Record> &
Omit<AppBskyFeedPost.Record, 'createdAt'>,
): Promise<{
uri: string
cid: string
}>
deletePost(postUri: string): Promise<void>
like(
uri: string,
cid: string,
): Promise<{
uri: string
cid: string
}>
deleteLike(likeUri: string): Promise<void>
repost(
uri: string,
cid: string,
): Promise<{
uri: string
cid: string
}>
deleteRepost(repostUri: string): Promise<void>
follow(subjectDid: string): Promise<{
uri: string
cid: string
}>
deleteFollow(followUri: string): Promise<void>
upsertProfile(
updateFn: (
existing: AppBskyActorProfile.Record | undefined,
) => AppBskyActorProfile.Record | Promise<AppBskyActorProfile.Record>,
): Promise<void>
mute(
actor: string,
): Promise<import('./client/types/app/bsky/graph/muteActor').Response>
unmute(
actor: string,
): Promise<import('./client/types/app/bsky/graph/unmuteActor').Response>
updateSeenNotifications(
seenAt?: string,
): Promise<import('./client/types/app/bsky/notification/updateSeen').Response>
}

@@ -1,79 +0,88 @@

import { ValidationResult } from '@atproto/lexicon';
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs';
import * as AppBskyGraphDefs from '../graph/defs';
import { ValidationResult } from '@atproto/lexicon'
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
import * as AppBskyGraphDefs from '../graph/defs'
export interface ProfileViewBasic {
did: string;
handle: string;
displayName?: string;
avatar?: string;
viewer?: ViewerState;
labels?: ComAtprotoLabelDefs.Label[];
[k: string]: unknown;
did: string
handle: string
displayName?: string
avatar?: string
viewer?: ViewerState
labels?: ComAtprotoLabelDefs.Label[]
[k: string]: unknown
}
export declare function isProfileViewBasic(v: unknown): v is ProfileViewBasic;
export declare function validateProfileViewBasic(v: unknown): ValidationResult;
export declare function isProfileViewBasic(v: unknown): v is ProfileViewBasic
export declare function validateProfileViewBasic(v: unknown): ValidationResult
export interface ProfileView {
did: string;
handle: string;
displayName?: string;
description?: string;
avatar?: string;
indexedAt?: string;
viewer?: ViewerState;
labels?: ComAtprotoLabelDefs.Label[];
[k: string]: unknown;
did: string
handle: string
displayName?: string
description?: string
avatar?: string
indexedAt?: string
viewer?: ViewerState
labels?: ComAtprotoLabelDefs.Label[]
[k: string]: unknown
}
export declare function isProfileView(v: unknown): v is ProfileView;
export declare function validateProfileView(v: unknown): ValidationResult;
export declare function isProfileView(v: unknown): v is ProfileView
export declare function validateProfileView(v: unknown): ValidationResult
export interface ProfileViewDetailed {
did: string;
handle: string;
displayName?: string;
description?: string;
avatar?: string;
banner?: string;
followersCount?: number;
followsCount?: number;
postsCount?: number;
indexedAt?: string;
viewer?: ViewerState;
labels?: ComAtprotoLabelDefs.Label[];
[k: string]: unknown;
did: string
handle: string
displayName?: string
description?: string
avatar?: string
banner?: string
followersCount?: number
followsCount?: number
postsCount?: number
indexedAt?: string
viewer?: ViewerState
labels?: ComAtprotoLabelDefs.Label[]
[k: string]: unknown
}
export declare function isProfileViewDetailed(v: unknown): v is ProfileViewDetailed;
export declare function validateProfileViewDetailed(v: unknown): ValidationResult;
export declare function isProfileViewDetailed(
v: unknown,
): v is ProfileViewDetailed
export declare function validateProfileViewDetailed(
v: unknown,
): ValidationResult
export interface ViewerState {
muted?: boolean;
mutedByList?: AppBskyGraphDefs.ListViewBasic;
blockedBy?: boolean;
blocking?: string;
following?: string;
followedBy?: string;
[k: string]: unknown;
muted?: boolean
mutedByList?: AppBskyGraphDefs.ListViewBasic
blockedBy?: boolean
blocking?: string
following?: string
followedBy?: string
[k: string]: unknown
}
export declare function isViewerState(v: unknown): v is ViewerState;
export declare function validateViewerState(v: unknown): ValidationResult;
export declare type Preferences = (AdultContentPref | ContentLabelPref | SavedFeedsPref | {
$type: string;
[k: string]: unknown;
})[];
export declare function isViewerState(v: unknown): v is ViewerState
export declare function validateViewerState(v: unknown): ValidationResult
export declare type Preferences = (
| AdultContentPref
| ContentLabelPref
| SavedFeedsPref
| {
$type: string
[k: string]: unknown
}
)[]
export interface AdultContentPref {
enabled: boolean;
[k: string]: unknown;
enabled: boolean
[k: string]: unknown
}
export declare function isAdultContentPref(v: unknown): v is AdultContentPref;
export declare function validateAdultContentPref(v: unknown): ValidationResult;
export declare function isAdultContentPref(v: unknown): v is AdultContentPref
export declare function validateAdultContentPref(v: unknown): ValidationResult
export interface ContentLabelPref {
label: string;
visibility: 'show' | 'warn' | 'hide' | (string & {});
[k: string]: unknown;
label: string
visibility: 'show' | 'warn' | 'hide' | (string & {})
[k: string]: unknown
}
export declare function isContentLabelPref(v: unknown): v is ContentLabelPref;
export declare function validateContentLabelPref(v: unknown): ValidationResult;
export declare function isContentLabelPref(v: unknown): v is ContentLabelPref
export declare function validateContentLabelPref(v: unknown): ValidationResult
export interface SavedFeedsPref {
pinned: string[];
saved: string[];
[k: string]: unknown;
pinned: string[]
saved: string[]
[k: string]: unknown
}
export declare function isSavedFeedsPref(v: unknown): v is SavedFeedsPref;
export declare function validateSavedFeedsPref(v: unknown): ValidationResult;
export declare function isSavedFeedsPref(v: unknown): v is SavedFeedsPref
export declare function validateSavedFeedsPref(v: unknown): ValidationResult
import { ValidationResult, BlobRef } from '@atproto/lexicon';
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs';
export interface Record {

@@ -7,2 +8,6 @@ displayName?: string;

banner?: BlobRef;
labels?: ComAtprotoLabelDefs.SelfLabels | {
$type: string;
[k: string]: unknown;
};
[k: string]: unknown;

@@ -9,0 +14,0 @@ }

@@ -1,31 +0,31 @@

import { ValidationResult, BlobRef } from '@atproto/lexicon';
import { ValidationResult, BlobRef } from '@atproto/lexicon'
export interface Main {
external: External;
[k: string]: unknown;
external: External
[k: string]: unknown
}
export declare function isMain(v: unknown): v is Main;
export declare function validateMain(v: unknown): ValidationResult;
export declare function isMain(v: unknown): v is Main
export declare function validateMain(v: unknown): ValidationResult
export interface External {
uri: string;
title: string;
description: string;
thumb?: BlobRef;
[k: string]: unknown;
uri: string
title: string
description: string
thumb?: BlobRef
[k: string]: unknown
}
export declare function isExternal(v: unknown): v is External;
export declare function validateExternal(v: unknown): ValidationResult;
export declare function isExternal(v: unknown): v is External
export declare function validateExternal(v: unknown): ValidationResult
export interface View {
external: ViewExternal;
[k: string]: unknown;
external: ViewExternal
[k: string]: unknown
}
export declare function isView(v: unknown): v is View;
export declare function validateView(v: unknown): ValidationResult;
export declare function isView(v: unknown): v is View
export declare function validateView(v: unknown): ValidationResult
export interface ViewExternal {
uri: string;
title: string;
description: string;
thumb?: string;
[k: string]: unknown;
uri: string
title: string
description: string
thumb?: string
[k: string]: unknown
}
export declare function isViewExternal(v: unknown): v is ViewExternal;
export declare function validateViewExternal(v: unknown): ValidationResult;
export declare function isViewExternal(v: unknown): v is ViewExternal
export declare function validateViewExternal(v: unknown): ValidationResult

@@ -1,28 +0,28 @@

import { ValidationResult, BlobRef } from '@atproto/lexicon';
import { ValidationResult, BlobRef } from '@atproto/lexicon'
export interface Main {
images: Image[];
[k: string]: unknown;
images: Image[]
[k: string]: unknown
}
export declare function isMain(v: unknown): v is Main;
export declare function validateMain(v: unknown): ValidationResult;
export declare function isMain(v: unknown): v is Main
export declare function validateMain(v: unknown): ValidationResult
export interface Image {
image: BlobRef;
alt: string;
[k: string]: unknown;
image: BlobRef
alt: string
[k: string]: unknown
}
export declare function isImage(v: unknown): v is Image;
export declare function validateImage(v: unknown): ValidationResult;
export declare function isImage(v: unknown): v is Image
export declare function validateImage(v: unknown): ValidationResult
export interface View {
images: ViewImage[];
[k: string]: unknown;
images: ViewImage[]
[k: string]: unknown
}
export declare function isView(v: unknown): v is View;
export declare function validateView(v: unknown): ValidationResult;
export declare function isView(v: unknown): v is View
export declare function validateView(v: unknown): ValidationResult
export interface ViewImage {
thumb: string;
fullsize: string;
alt: string;
[k: string]: unknown;
thumb: string
fullsize: string
alt: string
[k: string]: unknown
}
export declare function isViewImage(v: unknown): v is ViewImage;
export declare function validateViewImage(v: unknown): ValidationResult;
export declare function isViewImage(v: unknown): v is ViewImage
export declare function validateViewImage(v: unknown): ValidationResult

@@ -1,51 +0,63 @@

import { ValidationResult } from '@atproto/lexicon';
import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef';
import * as AppBskyFeedDefs from '../feed/defs';
import * as AppBskyGraphDefs from '../graph/defs';
import * as AppBskyActorDefs from '../actor/defs';
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs';
import * as AppBskyEmbedImages from './images';
import * as AppBskyEmbedExternal from './external';
import * as AppBskyEmbedRecordWithMedia from './recordWithMedia';
import { ValidationResult } from '@atproto/lexicon'
import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
import * as AppBskyFeedDefs from '../feed/defs'
import * as AppBskyGraphDefs from '../graph/defs'
import * as AppBskyActorDefs from '../actor/defs'
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
import * as AppBskyEmbedImages from './images'
import * as AppBskyEmbedExternal from './external'
import * as AppBskyEmbedRecordWithMedia from './recordWithMedia'
export interface Main {
record: ComAtprotoRepoStrongRef.Main;
[k: string]: unknown;
record: ComAtprotoRepoStrongRef.Main
[k: string]: unknown
}
export declare function isMain(v: unknown): v is Main;
export declare function validateMain(v: unknown): ValidationResult;
export declare function isMain(v: unknown): v is Main
export declare function validateMain(v: unknown): ValidationResult
export interface View {
record: ViewRecord | ViewNotFound | ViewBlocked | AppBskyFeedDefs.GeneratorView | AppBskyGraphDefs.ListView | {
$type: string;
[k: string]: unknown;
};
[k: string]: unknown;
record:
| ViewRecord
| ViewNotFound
| ViewBlocked
| AppBskyFeedDefs.GeneratorView
| AppBskyGraphDefs.ListView
| {
$type: string
[k: string]: unknown
}
[k: string]: unknown
}
export declare function isView(v: unknown): v is View;
export declare function validateView(v: unknown): ValidationResult;
export declare function isView(v: unknown): v is View
export declare function validateView(v: unknown): ValidationResult
export interface ViewRecord {
uri: string;
cid: string;
author: AppBskyActorDefs.ProfileViewBasic;
value: {};
labels?: ComAtprotoLabelDefs.Label[];
embeds?: (AppBskyEmbedImages.View | AppBskyEmbedExternal.View | View | AppBskyEmbedRecordWithMedia.View | {
$type: string;
[k: string]: unknown;
})[];
indexedAt: string;
[k: string]: unknown;
uri: string
cid: string
author: AppBskyActorDefs.ProfileViewBasic
value: {}
labels?: ComAtprotoLabelDefs.Label[]
embeds?: (
| AppBskyEmbedImages.View
| AppBskyEmbedExternal.View
| View
| AppBskyEmbedRecordWithMedia.View
| {
$type: string
[k: string]: unknown
}
)[]
indexedAt: string
[k: string]: unknown
}
export declare function isViewRecord(v: unknown): v is ViewRecord;
export declare function validateViewRecord(v: unknown): ValidationResult;
export declare function isViewRecord(v: unknown): v is ViewRecord
export declare function validateViewRecord(v: unknown): ValidationResult
export interface ViewNotFound {
uri: string;
[k: string]: unknown;
uri: string
[k: string]: unknown
}
export declare function isViewNotFound(v: unknown): v is ViewNotFound;
export declare function validateViewNotFound(v: unknown): ValidationResult;
export declare function isViewNotFound(v: unknown): v is ViewNotFound
export declare function validateViewNotFound(v: unknown): ValidationResult
export interface ViewBlocked {
uri: string;
[k: string]: unknown;
uri: string
[k: string]: unknown
}
export declare function isViewBlocked(v: unknown): v is ViewBlocked;
export declare function validateViewBlocked(v: unknown): ValidationResult;
export declare function isViewBlocked(v: unknown): v is ViewBlocked
export declare function validateViewBlocked(v: unknown): ValidationResult

@@ -1,24 +0,30 @@

import { ValidationResult } from '@atproto/lexicon';
import * as AppBskyEmbedRecord from './record';
import * as AppBskyEmbedImages from './images';
import * as AppBskyEmbedExternal from './external';
import { ValidationResult } from '@atproto/lexicon'
import * as AppBskyEmbedRecord from './record'
import * as AppBskyEmbedImages from './images'
import * as AppBskyEmbedExternal from './external'
export interface Main {
record: AppBskyEmbedRecord.Main;
media: AppBskyEmbedImages.Main | AppBskyEmbedExternal.Main | {
$type: string;
[k: string]: unknown;
};
[k: string]: unknown;
record: AppBskyEmbedRecord.Main
media:
| AppBskyEmbedImages.Main
| AppBskyEmbedExternal.Main
| {
$type: string
[k: string]: unknown
}
[k: string]: unknown
}
export declare function isMain(v: unknown): v is Main;
export declare function validateMain(v: unknown): ValidationResult;
export declare function isMain(v: unknown): v is Main
export declare function validateMain(v: unknown): ValidationResult
export interface View {
record: AppBskyEmbedRecord.View;
media: AppBskyEmbedImages.View | AppBskyEmbedExternal.View | {
$type: string;
[k: string]: unknown;
};
[k: string]: unknown;
record: AppBskyEmbedRecord.View
media:
| AppBskyEmbedImages.View
| AppBskyEmbedExternal.View
| {
$type: string
[k: string]: unknown
}
[k: string]: unknown
}
export declare function isView(v: unknown): v is View;
export declare function validateView(v: unknown): ValidationResult;
export declare function isView(v: unknown): v is View
export declare function validateView(v: unknown): ValidationResult

@@ -1,131 +0,165 @@

import { ValidationResult } from '@atproto/lexicon';
import * as AppBskyActorDefs from '../actor/defs';
import * as AppBskyEmbedImages from '../embed/images';
import * as AppBskyEmbedExternal from '../embed/external';
import * as AppBskyEmbedRecord from '../embed/record';
import * as AppBskyEmbedRecordWithMedia from '../embed/recordWithMedia';
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs';
import * as AppBskyRichtextFacet from '../richtext/facet';
import { ValidationResult } from '@atproto/lexicon'
import * as AppBskyActorDefs from '../actor/defs'
import * as AppBskyEmbedImages from '../embed/images'
import * as AppBskyEmbedExternal from '../embed/external'
import * as AppBskyEmbedRecord from '../embed/record'
import * as AppBskyEmbedRecordWithMedia from '../embed/recordWithMedia'
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
import * as AppBskyRichtextFacet from '../richtext/facet'
export interface PostView {
uri: string;
cid: string;
author: AppBskyActorDefs.ProfileViewBasic;
record: {};
embed?: AppBskyEmbedImages.View | AppBskyEmbedExternal.View | AppBskyEmbedRecord.View | AppBskyEmbedRecordWithMedia.View | {
$type: string;
[k: string]: unknown;
};
replyCount?: number;
repostCount?: number;
likeCount?: number;
indexedAt: string;
viewer?: ViewerState;
labels?: ComAtprotoLabelDefs.Label[];
[k: string]: unknown;
uri: string
cid: string
author: AppBskyActorDefs.ProfileViewBasic
record: {}
embed?:
| AppBskyEmbedImages.View
| AppBskyEmbedExternal.View
| AppBskyEmbedRecord.View
| AppBskyEmbedRecordWithMedia.View
| {
$type: string
[k: string]: unknown
}
replyCount?: number
repostCount?: number
likeCount?: number
indexedAt: string
viewer?: ViewerState
labels?: ComAtprotoLabelDefs.Label[]
[k: string]: unknown
}
export declare function isPostView(v: unknown): v is PostView;
export declare function validatePostView(v: unknown): ValidationResult;
export declare function isPostView(v: unknown): v is PostView
export declare function validatePostView(v: unknown): ValidationResult
export interface ViewerState {
repost?: string;
like?: string;
[k: string]: unknown;
repost?: string
like?: string
[k: string]: unknown
}
export declare function isViewerState(v: unknown): v is ViewerState;
export declare function validateViewerState(v: unknown): ValidationResult;
export declare function isViewerState(v: unknown): v is ViewerState
export declare function validateViewerState(v: unknown): ValidationResult
export interface FeedViewPost {
post: PostView;
reply?: ReplyRef;
reason?: ReasonRepost | {
$type: string;
[k: string]: unknown;
};
[k: string]: unknown;
post: PostView
reply?: ReplyRef
reason?:
| ReasonRepost
| {
$type: string
[k: string]: unknown
}
[k: string]: unknown
}
export declare function isFeedViewPost(v: unknown): v is FeedViewPost;
export declare function validateFeedViewPost(v: unknown): ValidationResult;
export declare function isFeedViewPost(v: unknown): v is FeedViewPost
export declare function validateFeedViewPost(v: unknown): ValidationResult
export interface ReplyRef {
root: PostView | NotFoundPost | BlockedPost | {
$type: string;
[k: string]: unknown;
};
parent: PostView | NotFoundPost | BlockedPost | {
$type: string;
[k: string]: unknown;
};
[k: string]: unknown;
root:
| PostView
| NotFoundPost
| BlockedPost
| {
$type: string
[k: string]: unknown
}
parent:
| PostView
| NotFoundPost
| BlockedPost
| {
$type: string
[k: string]: unknown
}
[k: string]: unknown
}
export declare function isReplyRef(v: unknown): v is ReplyRef;
export declare function validateReplyRef(v: unknown): ValidationResult;
export declare function isReplyRef(v: unknown): v is ReplyRef
export declare function validateReplyRef(v: unknown): ValidationResult
export interface ReasonRepost {
by: AppBskyActorDefs.ProfileViewBasic;
indexedAt: string;
[k: string]: unknown;
by: AppBskyActorDefs.ProfileViewBasic
indexedAt: string
[k: string]: unknown
}
export declare function isReasonRepost(v: unknown): v is ReasonRepost;
export declare function validateReasonRepost(v: unknown): ValidationResult;
export declare function isReasonRepost(v: unknown): v is ReasonRepost
export declare function validateReasonRepost(v: unknown): ValidationResult
export interface ThreadViewPost {
post: PostView;
parent?: ThreadViewPost | NotFoundPost | BlockedPost | {
$type: string;
[k: string]: unknown;
};
replies?: (ThreadViewPost | NotFoundPost | BlockedPost | {
$type: string;
[k: string]: unknown;
})[];
[k: string]: unknown;
post: PostView
parent?:
| ThreadViewPost
| NotFoundPost
| BlockedPost
| {
$type: string
[k: string]: unknown
}
replies?: (
| ThreadViewPost
| NotFoundPost
| BlockedPost
| {
$type: string
[k: string]: unknown
}
)[]
[k: string]: unknown
}
export declare function isThreadViewPost(v: unknown): v is ThreadViewPost;
export declare function validateThreadViewPost(v: unknown): ValidationResult;
export declare function isThreadViewPost(v: unknown): v is ThreadViewPost
export declare function validateThreadViewPost(v: unknown): ValidationResult
export interface NotFoundPost {
uri: string;
notFound: true;
[k: string]: unknown;
uri: string
notFound: true
[k: string]: unknown
}
export declare function isNotFoundPost(v: unknown): v is NotFoundPost;
export declare function validateNotFoundPost(v: unknown): ValidationResult;
export declare function isNotFoundPost(v: unknown): v is NotFoundPost
export declare function validateNotFoundPost(v: unknown): ValidationResult
export interface BlockedPost {
uri: string;
blocked: true;
[k: string]: unknown;
uri: string
blocked: true
[k: string]: unknown
}
export declare function isBlockedPost(v: unknown): v is BlockedPost;
export declare function validateBlockedPost(v: unknown): ValidationResult;
export declare function isBlockedPost(v: unknown): v is BlockedPost
export declare function validateBlockedPost(v: unknown): ValidationResult
export interface GeneratorView {
uri: string;
cid: string;
did: string;
creator: AppBskyActorDefs.ProfileView;
displayName: string;
description?: string;
descriptionFacets?: AppBskyRichtextFacet.Main[];
avatar?: string;
likeCount?: number;
viewer?: GeneratorViewerState;
indexedAt: string;
[k: string]: unknown;
uri: string
cid: string
did: string
creator: AppBskyActorDefs.ProfileView
displayName: string
description?: string
descriptionFacets?: AppBskyRichtextFacet.Main[]
avatar?: string
likeCount?: number
viewer?: GeneratorViewerState
indexedAt: string
[k: string]: unknown
}
export declare function isGeneratorView(v: unknown): v is GeneratorView;
export declare function validateGeneratorView(v: unknown): ValidationResult;
export declare function isGeneratorView(v: unknown): v is GeneratorView
export declare function validateGeneratorView(v: unknown): ValidationResult
export interface GeneratorViewerState {
like?: string;
[k: string]: unknown;
like?: string
[k: string]: unknown
}
export declare function isGeneratorViewerState(v: unknown): v is GeneratorViewerState;
export declare function validateGeneratorViewerState(v: unknown): ValidationResult;
export declare function isGeneratorViewerState(
v: unknown,
): v is GeneratorViewerState
export declare function validateGeneratorViewerState(
v: unknown,
): ValidationResult
export interface SkeletonFeedPost {
post: string;
reason?: SkeletonReasonRepost | {
$type: string;
[k: string]: unknown;
};
[k: string]: unknown;
post: string
reason?:
| SkeletonReasonRepost
| {
$type: string
[k: string]: unknown
}
[k: string]: unknown
}
export declare function isSkeletonFeedPost(v: unknown): v is SkeletonFeedPost;
export declare function validateSkeletonFeedPost(v: unknown): ValidationResult;
export declare function isSkeletonFeedPost(v: unknown): v is SkeletonFeedPost
export declare function validateSkeletonFeedPost(v: unknown): ValidationResult
export interface SkeletonReasonRepost {
repost: string;
[k: string]: unknown;
repost: string
[k: string]: unknown
}
export declare function isSkeletonReasonRepost(v: unknown): v is SkeletonReasonRepost;
export declare function validateSkeletonReasonRepost(v: unknown): ValidationResult;
export declare function isSkeletonReasonRepost(
v: unknown,
): v is SkeletonReasonRepost
export declare function validateSkeletonReasonRepost(
v: unknown,
): ValidationResult
import { ValidationResult, BlobRef } from '@atproto/lexicon';
import * as AppBskyRichtextFacet from '../richtext/facet';
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs';
export interface Record {

@@ -9,2 +10,6 @@ did: string;

avatar?: BlobRef;
labels?: ComAtprotoLabelDefs.SelfLabels | {
$type: string;
[k: string]: unknown;
};
createdAt: string;

@@ -11,0 +16,0 @@ [k: string]: unknown;

@@ -7,2 +7,3 @@ import { Headers, XRPCError } from '@atproto/xrpc';

cursor?: string;
filter?: 'posts_with_replies' | 'posts_no_replies' | 'posts_with_media' | (string & {});
}

@@ -9,0 +10,0 @@ export declare type InputSchema = undefined;

@@ -1,9 +0,9 @@

import { ValidationResult } from '@atproto/lexicon';
import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef';
import { ValidationResult } from '@atproto/lexicon'
import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
export interface Record {
subject: ComAtprotoRepoStrongRef.Main;
createdAt: string;
[k: string]: unknown;
subject: ComAtprotoRepoStrongRef.Main
createdAt: string
[k: string]: unknown
}
export declare function isRecord(v: unknown): v is Record;
export declare function validateRecord(v: unknown): ValidationResult;
export declare function isRecord(v: unknown): v is Record
export declare function validateRecord(v: unknown): ValidationResult

@@ -7,2 +7,3 @@ import { ValidationResult } from '@atproto/lexicon';

import * as AppBskyEmbedRecordWithMedia from '../embed/recordWithMedia';
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs';
import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef';

@@ -19,2 +20,6 @@ export interface Record {

langs?: string[];
labels?: ComAtprotoLabelDefs.SelfLabels | {
$type: string;
[k: string]: unknown;
};
createdAt: string;

@@ -21,0 +26,0 @@ [k: string]: unknown;

@@ -1,9 +0,9 @@

import { ValidationResult } from '@atproto/lexicon';
import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef';
import { ValidationResult } from '@atproto/lexicon'
import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
export interface Record {
subject: ComAtprotoRepoStrongRef.Main;
createdAt: string;
[k: string]: unknown;
subject: ComAtprotoRepoStrongRef.Main
createdAt: string
[k: string]: unknown
}
export declare function isRecord(v: unknown): v is Record;
export declare function validateRecord(v: unknown): ValidationResult;
export declare function isRecord(v: unknown): v is Record
export declare function validateRecord(v: unknown): ValidationResult

@@ -1,8 +0,8 @@

import { ValidationResult } from '@atproto/lexicon';
import { ValidationResult } from '@atproto/lexicon'
export interface Record {
subject: string;
createdAt: string;
[k: string]: unknown;
subject: string
createdAt: string
[k: string]: unknown
}
export declare function isRecord(v: unknown): v is Record;
export declare function validateRecord(v: unknown): ValidationResult;
export declare function isRecord(v: unknown): v is Record
export declare function validateRecord(v: unknown): ValidationResult

@@ -1,44 +0,44 @@

import { ValidationResult } from '@atproto/lexicon';
import * as AppBskyActorDefs from '../actor/defs';
import * as AppBskyRichtextFacet from '../richtext/facet';
import { ValidationResult } from '@atproto/lexicon'
import * as AppBskyActorDefs from '../actor/defs'
import * as AppBskyRichtextFacet from '../richtext/facet'
export interface ListViewBasic {
uri: string;
cid: string;
name: string;
purpose: ListPurpose;
avatar?: string;
viewer?: ListViewerState;
indexedAt?: string;
[k: string]: unknown;
uri: string
cid: string
name: string
purpose: ListPurpose
avatar?: string
viewer?: ListViewerState
indexedAt?: string
[k: string]: unknown
}
export declare function isListViewBasic(v: unknown): v is ListViewBasic;
export declare function validateListViewBasic(v: unknown): ValidationResult;
export declare function isListViewBasic(v: unknown): v is ListViewBasic
export declare function validateListViewBasic(v: unknown): ValidationResult
export interface ListView {
uri: string;
cid: string;
creator: AppBskyActorDefs.ProfileView;
name: string;
purpose: ListPurpose;
description?: string;
descriptionFacets?: AppBskyRichtextFacet.Main[];
avatar?: string;
viewer?: ListViewerState;
indexedAt: string;
[k: string]: unknown;
uri: string
cid: string
creator: AppBskyActorDefs.ProfileView
name: string
purpose: ListPurpose
description?: string
descriptionFacets?: AppBskyRichtextFacet.Main[]
avatar?: string
viewer?: ListViewerState
indexedAt: string
[k: string]: unknown
}
export declare function isListView(v: unknown): v is ListView;
export declare function validateListView(v: unknown): ValidationResult;
export declare function isListView(v: unknown): v is ListView
export declare function validateListView(v: unknown): ValidationResult
export interface ListItemView {
subject: AppBskyActorDefs.ProfileView;
[k: string]: unknown;
subject: AppBskyActorDefs.ProfileView
[k: string]: unknown
}
export declare function isListItemView(v: unknown): v is ListItemView;
export declare function validateListItemView(v: unknown): ValidationResult;
export declare type ListPurpose = 'app.bsky.graph.defs#modlist' | (string & {});
export declare const MODLIST = "app.bsky.graph.defs#modlist";
export declare function isListItemView(v: unknown): v is ListItemView
export declare function validateListItemView(v: unknown): ValidationResult
export declare type ListPurpose = 'app.bsky.graph.defs#modlist' | (string & {})
export declare const MODLIST = 'app.bsky.graph.defs#modlist'
export interface ListViewerState {
muted?: boolean;
[k: string]: unknown;
muted?: boolean
[k: string]: unknown
}
export declare function isListViewerState(v: unknown): v is ListViewerState;
export declare function validateListViewerState(v: unknown): ValidationResult;
export declare function isListViewerState(v: unknown): v is ListViewerState
export declare function validateListViewerState(v: unknown): ValidationResult

@@ -1,8 +0,8 @@

import { ValidationResult } from '@atproto/lexicon';
import { ValidationResult } from '@atproto/lexicon'
export interface Record {
subject: string;
createdAt: string;
[k: string]: unknown;
subject: string
createdAt: string
[k: string]: unknown
}
export declare function isRecord(v: unknown): v is Record;
export declare function validateRecord(v: unknown): ValidationResult;
export declare function isRecord(v: unknown): v is Record
export declare function validateRecord(v: unknown): ValidationResult
import { ValidationResult, BlobRef } from '@atproto/lexicon';
import * as AppBskyGraphDefs from './defs';
import * as AppBskyRichtextFacet from '../richtext/facet';
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs';
export interface Record {

@@ -10,2 +11,6 @@ purpose: AppBskyGraphDefs.ListPurpose;

avatar?: BlobRef;
labels?: ComAtprotoLabelDefs.SelfLabels | {
$type: string;
[k: string]: unknown;
};
createdAt: string;

@@ -12,0 +17,0 @@ [k: string]: unknown;

@@ -1,9 +0,9 @@

import { ValidationResult } from '@atproto/lexicon';
import { ValidationResult } from '@atproto/lexicon'
export interface Record {
subject: string;
list: string;
createdAt: string;
[k: string]: unknown;
subject: string
list: string
createdAt: string
[k: string]: unknown
}
export declare function isRecord(v: unknown): v is Record;
export declare function validateRecord(v: unknown): ValidationResult;
export declare function isRecord(v: unknown): v is Record
export declare function validateRecord(v: unknown): ValidationResult

@@ -1,30 +0,34 @@

import { ValidationResult } from '@atproto/lexicon';
import { ValidationResult } from '@atproto/lexicon'
export interface Main {
index: ByteSlice;
features: (Mention | Link | {
$type: string;
[k: string]: unknown;
})[];
[k: string]: unknown;
index: ByteSlice
features: (
| Mention
| Link
| {
$type: string
[k: string]: unknown
}
)[]
[k: string]: unknown
}
export declare function isMain(v: unknown): v is Main;
export declare function validateMain(v: unknown): ValidationResult;
export declare function isMain(v: unknown): v is Main
export declare function validateMain(v: unknown): ValidationResult
export interface Mention {
did: string;
[k: string]: unknown;
did: string
[k: string]: unknown
}
export declare function isMention(v: unknown): v is Mention;
export declare function validateMention(v: unknown): ValidationResult;
export declare function isMention(v: unknown): v is Mention
export declare function validateMention(v: unknown): ValidationResult
export interface Link {
uri: string;
[k: string]: unknown;
uri: string
[k: string]: unknown
}
export declare function isLink(v: unknown): v is Link;
export declare function validateLink(v: unknown): ValidationResult;
export declare function isLink(v: unknown): v is Link
export declare function validateLink(v: unknown): ValidationResult
export interface ByteSlice {
byteStart: number;
byteEnd: number;
[k: string]: unknown;
byteStart: number
byteEnd: number
[k: string]: unknown
}
export declare function isByteSlice(v: unknown): v is ByteSlice;
export declare function validateByteSlice(v: unknown): ValidationResult;
export declare function isByteSlice(v: unknown): v is ByteSlice
export declare function validateByteSlice(v: unknown): ValidationResult

@@ -13,1 +13,13 @@ import { ValidationResult } from '@atproto/lexicon';

export declare function validateLabel(v: unknown): ValidationResult;
export interface SelfLabels {
values: SelfLabel[];
[k: string]: unknown;
}
export declare function isSelfLabels(v: unknown): v is SelfLabels;
export declare function validateSelfLabels(v: unknown): ValidationResult;
export interface SelfLabel {
val: string;
[k: string]: unknown;
}
export declare function isSelfLabel(v: unknown): v is SelfLabel;
export declare function validateSelfLabel(v: unknown): ValidationResult;

@@ -1,16 +0,16 @@

import { ValidationResult } from '@atproto/lexicon';
import * as ComAtprotoLabelDefs from './defs';
import { ValidationResult } from '@atproto/lexicon'
import * as ComAtprotoLabelDefs from './defs'
export interface Labels {
seq: number;
labels: ComAtprotoLabelDefs.Label[];
[k: string]: unknown;
seq: number
labels: ComAtprotoLabelDefs.Label[]
[k: string]: unknown
}
export declare function isLabels(v: unknown): v is Labels;
export declare function validateLabels(v: unknown): ValidationResult;
export declare function isLabels(v: unknown): v is Labels
export declare function validateLabels(v: unknown): ValidationResult
export interface Info {
name: 'OutdatedCursor' | (string & {});
message?: string;
[k: string]: unknown;
name: 'OutdatedCursor' | (string & {})
message?: string
[k: string]: unknown
}
export declare function isInfo(v: unknown): v is Info;
export declare function validateInfo(v: unknown): ValidationResult;
export declare function isInfo(v: unknown): v is Info
export declare function validateInfo(v: unknown): ValidationResult

@@ -1,7 +0,16 @@

export declare type ReasonType = 'com.atproto.moderation.defs#reasonSpam' | 'com.atproto.moderation.defs#reasonViolation' | 'com.atproto.moderation.defs#reasonMisleading' | 'com.atproto.moderation.defs#reasonSexual' | 'com.atproto.moderation.defs#reasonRude' | 'com.atproto.moderation.defs#reasonOther' | (string & {});
export declare const REASONSPAM = "com.atproto.moderation.defs#reasonSpam";
export declare const REASONVIOLATION = "com.atproto.moderation.defs#reasonViolation";
export declare const REASONMISLEADING = "com.atproto.moderation.defs#reasonMisleading";
export declare const REASONSEXUAL = "com.atproto.moderation.defs#reasonSexual";
export declare const REASONRUDE = "com.atproto.moderation.defs#reasonRude";
export declare const REASONOTHER = "com.atproto.moderation.defs#reasonOther";
export declare type ReasonType =
| 'com.atproto.moderation.defs#reasonSpam'
| 'com.atproto.moderation.defs#reasonViolation'
| 'com.atproto.moderation.defs#reasonMisleading'
| 'com.atproto.moderation.defs#reasonSexual'
| 'com.atproto.moderation.defs#reasonRude'
| 'com.atproto.moderation.defs#reasonOther'
| (string & {})
export declare const REASONSPAM = 'com.atproto.moderation.defs#reasonSpam'
export declare const REASONVIOLATION =
'com.atproto.moderation.defs#reasonViolation'
export declare const REASONMISLEADING =
'com.atproto.moderation.defs#reasonMisleading'
export declare const REASONSEXUAL = 'com.atproto.moderation.defs#reasonSexual'
export declare const REASONRUDE = 'com.atproto.moderation.defs#reasonRude'
export declare const REASONOTHER = 'com.atproto.moderation.defs#reasonOther'

@@ -1,8 +0,8 @@

import { ValidationResult } from '@atproto/lexicon';
import { ValidationResult } from '@atproto/lexicon'
export interface Main {
uri: string;
cid: string;
[k: string]: unknown;
uri: string
cid: string
[k: string]: unknown
}
export declare function isMain(v: unknown): v is Main;
export declare function validateMain(v: unknown): ValidationResult;
export declare function isMain(v: unknown): v is Main
export declare function validateMain(v: unknown): ValidationResult

@@ -1,20 +0,20 @@

import { ValidationResult } from '@atproto/lexicon';
import { ValidationResult } from '@atproto/lexicon'
export interface InviteCode {
code: string;
available: number;
disabled: boolean;
forAccount: string;
createdBy: string;
createdAt: string;
uses: InviteCodeUse[];
[k: string]: unknown;
code: string
available: number
disabled: boolean
forAccount: string
createdBy: string
createdAt: string
uses: InviteCodeUse[]
[k: string]: unknown
}
export declare function isInviteCode(v: unknown): v is InviteCode;
export declare function validateInviteCode(v: unknown): ValidationResult;
export declare function isInviteCode(v: unknown): v is InviteCode
export declare function validateInviteCode(v: unknown): ValidationResult
export interface InviteCodeUse {
usedBy: string;
usedAt: string;
[k: string]: unknown;
usedBy: string
usedAt: string
[k: string]: unknown
}
export declare function isInviteCodeUse(v: unknown): v is InviteCodeUse;
export declare function validateInviteCodeUse(v: unknown): ValidationResult;
export declare function isInviteCodeUse(v: unknown): v is InviteCodeUse
export declare function validateInviteCodeUse(v: unknown): ValidationResult

@@ -1,58 +0,58 @@

import { ValidationResult } from '@atproto/lexicon';
import { CID } from 'multiformats/cid';
import { ValidationResult } from '@atproto/lexicon'
import { CID } from 'multiformats/cid'
export interface Commit {
seq: number;
rebase: boolean;
tooBig: boolean;
repo: string;
commit: CID;
prev: CID | null;
blocks: Uint8Array;
ops: RepoOp[];
blobs: CID[];
time: string;
[k: string]: unknown;
seq: number
rebase: boolean
tooBig: boolean
repo: string
commit: CID
prev: CID | null
blocks: Uint8Array
ops: RepoOp[]
blobs: CID[]
time: string
[k: string]: unknown
}
export declare function isCommit(v: unknown): v is Commit;
export declare function validateCommit(v: unknown): ValidationResult;
export declare function isCommit(v: unknown): v is Commit
export declare function validateCommit(v: unknown): ValidationResult
export interface Handle {
seq: number;
did: string;
handle: string;
time: string;
[k: string]: unknown;
seq: number
did: string
handle: string
time: string
[k: string]: unknown
}
export declare function isHandle(v: unknown): v is Handle;
export declare function validateHandle(v: unknown): ValidationResult;
export declare function isHandle(v: unknown): v is Handle
export declare function validateHandle(v: unknown): ValidationResult
export interface Migrate {
seq: number;
did: string;
migrateTo: string | null;
time: string;
[k: string]: unknown;
seq: number
did: string
migrateTo: string | null
time: string
[k: string]: unknown
}
export declare function isMigrate(v: unknown): v is Migrate;
export declare function validateMigrate(v: unknown): ValidationResult;
export declare function isMigrate(v: unknown): v is Migrate
export declare function validateMigrate(v: unknown): ValidationResult
export interface Tombstone {
seq: number;
did: string;
time: string;
[k: string]: unknown;
seq: number
did: string
time: string
[k: string]: unknown
}
export declare function isTombstone(v: unknown): v is Tombstone;
export declare function validateTombstone(v: unknown): ValidationResult;
export declare function isTombstone(v: unknown): v is Tombstone
export declare function validateTombstone(v: unknown): ValidationResult
export interface Info {
name: 'OutdatedCursor' | (string & {});
message?: string;
[k: string]: unknown;
name: 'OutdatedCursor' | (string & {})
message?: string
[k: string]: unknown
}
export declare function isInfo(v: unknown): v is Info;
export declare function validateInfo(v: unknown): ValidationResult;
export declare function isInfo(v: unknown): v is Info
export declare function validateInfo(v: unknown): ValidationResult
export interface RepoOp {
action: 'create' | 'update' | 'delete' | (string & {});
path: string;
cid: CID | null;
[k: string]: unknown;
action: 'create' | 'update' | 'delete' | (string & {})
path: string
cid: CID | null
[k: string]: unknown
}
export declare function isRepoOp(v: unknown): v is RepoOp;
export declare function validateRepoOp(v: unknown): ValidationResult;
export declare function isRepoOp(v: unknown): v is RepoOp
export declare function validateRepoOp(v: unknown): ValidationResult

@@ -1,2 +0,5 @@

export declare function isObj(v: unknown): v is Record<string, unknown>;
export declare function hasProp<K extends PropertyKey>(data: object, prop: K): data is Record<K, unknown>;
export declare function isObj(v: unknown): v is Record<string, unknown>
export declare function hasProp<K extends PropertyKey>(
data: object,
prop: K,
): data is Record<K, unknown>

@@ -40,3 +40,3 @@ import { AppBskyActorDefs, AppBskyFeedDefs, AppBskyGraphDefs, ComAtprotoLabelDefs } from '../client/index';

labeler: Labeler;
settings: Record<string, LabelPreference>;
labels: Record<string, LabelPreference>;
}

@@ -53,2 +53,5 @@ export declare type ModerationSubjectProfile = AppBskyActorDefs.ProfileViewBasic | AppBskyActorDefs.ProfileView | AppBskyActorDefs.ProfileViewDetailed;

list: AppBskyGraphDefs.ListViewBasic;
} | {
type: 'labeler';
labeler: Labeler;
};

@@ -65,3 +68,3 @@ export declare type ModerationCause = {

type: 'label';
labeler: Labeler;
source: ModerationCauseSource;
label: Label;

@@ -79,3 +82,4 @@ labelDef: LabelDefinition;

adultContentEnabled: boolean;
labelerSettings: LabelerSettings[];
labels: Record<string, LabelPreference>;
labelers: LabelerSettings[];
}

@@ -82,0 +86,0 @@ export declare class ModerationDecision {

@@ -1,4 +0,4 @@

import { AppBskyRichtextFacet } from '../client';
import { UnicodeString } from './unicode';
export declare type Facet = AppBskyRichtextFacet.Main;
export declare function detectFacets(text: UnicodeString): Facet[] | undefined;
import { AppBskyRichtextFacet } from '../client'
import { UnicodeString } from './unicode'
export declare type Facet = AppBskyRichtextFacet.Main
export declare function detectFacets(text: UnicodeString): Facet[] | undefined

@@ -1,39 +0,39 @@

import { AtpAgent } from '../agent';
import { AppBskyFeedPost, AppBskyRichtextFacet } from '../client';
import { UnicodeString } from './unicode';
export declare type Facet = AppBskyRichtextFacet.Main;
export declare type FacetLink = AppBskyRichtextFacet.Link;
export declare type FacetMention = AppBskyRichtextFacet.Mention;
export declare type Entity = AppBskyFeedPost.Entity;
import { AtpAgent } from '../agent'
import { AppBskyFeedPost, AppBskyRichtextFacet } from '../client'
import { UnicodeString } from './unicode'
export declare type Facet = AppBskyRichtextFacet.Main
export declare type FacetLink = AppBskyRichtextFacet.Link
export declare type FacetMention = AppBskyRichtextFacet.Mention
export declare type Entity = AppBskyFeedPost.Entity
export interface RichTextProps {
text: string;
facets?: Facet[];
entities?: Entity[];
text: string
facets?: Facet[]
entities?: Entity[]
}
export interface RichTextOpts {
cleanNewlines?: boolean;
cleanNewlines?: boolean
}
export declare class RichTextSegment {
text: string;
facet?: AppBskyRichtextFacet.Main | undefined;
constructor(text: string, facet?: AppBskyRichtextFacet.Main | undefined);
get link(): FacetLink | undefined;
isLink(): boolean;
get mention(): FacetMention | undefined;
isMention(): boolean;
text: string
facet?: AppBskyRichtextFacet.Main | undefined
constructor(text: string, facet?: AppBskyRichtextFacet.Main | undefined)
get link(): FacetLink | undefined
isLink(): boolean
get mention(): FacetMention | undefined
isMention(): boolean
}
export declare class RichText {
unicodeText: UnicodeString;
facets?: Facet[];
constructor(props: RichTextProps, opts?: RichTextOpts);
get text(): string;
get length(): number;
get graphemeLength(): number;
clone(): RichText;
copyInto(target: RichText): void;
segments(): Generator<RichTextSegment, void, void>;
insert(insertIndex: number, insertText: string): this;
delete(removeStartIndex: number, removeEndIndex: number): this;
detectFacets(agent: AtpAgent): Promise<void>;
detectFacetsWithoutResolution(): void;
unicodeText: UnicodeString
facets?: Facet[]
constructor(props: RichTextProps, opts?: RichTextOpts)
get text(): string
get length(): number
get graphemeLength(): number
clone(): RichText
copyInto(target: RichText): void
segments(): Generator<RichTextSegment, void, void>
insert(insertIndex: number, insertText: string): this
delete(removeStartIndex: number, removeEndIndex: number): this
detectFacets(agent: AtpAgent): Promise<void>
detectFacetsWithoutResolution(): void
}

@@ -1,4 +0,7 @@

import { RichText } from './rich-text';
export declare function sanitizeRichText(richText: RichText, opts: {
cleanNewlines?: boolean;
}): RichText;
import { RichText } from './rich-text'
export declare function sanitizeRichText(
richText: RichText,
opts: {
cleanNewlines?: boolean
},
): RichText
export declare class UnicodeString {
utf16: string;
utf8: Uint8Array;
private _graphemeLen?;
constructor(utf16: string);
get length(): number;
get graphemeLength(): number;
slice(start?: number, end?: number): string;
utf16IndexToUtf8Index(i: number): number;
toString(): string;
utf16: string
utf8: Uint8Array
private _graphemeLen?
constructor(utf16: string)
get length(): number
get graphemeLength(): number
slice(start?: number, end?: number): string
utf16IndexToUtf8Index(i: number): number
toString(): string
}

@@ -1,34 +0,46 @@

export declare type AtpSessionEvent = 'create' | 'create-failed' | 'update' | 'expired';
export declare type AtpSessionEvent =
| 'create'
| 'create-failed'
| 'update'
| 'expired'
export interface AtpSessionData {
refreshJwt: string;
accessJwt: string;
handle: string;
did: string;
email?: string;
refreshJwt: string
accessJwt: string
handle: string
did: string
email?: string
}
export declare type AtpPersistSessionHandler = (evt: AtpSessionEvent, session: AtpSessionData | undefined) => void | Promise<void>;
export declare type AtpPersistSessionHandler = (
evt: AtpSessionEvent,
session: AtpSessionData | undefined,
) => void | Promise<void>
export interface AtpAgentOpts {
service: string | URL;
persistSession?: AtpPersistSessionHandler;
service: string | URL
persistSession?: AtpPersistSessionHandler
}
export interface AtpAgentCreateAccountOpts {
email: string;
password: string;
handle: string;
inviteCode?: string;
email: string
password: string
handle: string
inviteCode?: string
}
export interface AtpAgentLoginOpts {
identifier: string;
password: string;
identifier: string
password: string
}
declare type AtpAgentFetchHeaders = Record<string, string>;
declare type AtpAgentFetchHeaders = Record<string, string>
export interface AtpAgentFetchHandlerResponse {
status: number;
headers: Record<string, string>;
body: any;
status: number
headers: Record<string, string>
body: any
}
export declare type AtpAgentFetchHandler = (httpUri: string, httpMethod: string, httpHeaders: AtpAgentFetchHeaders, httpReqBody: any) => Promise<AtpAgentFetchHandlerResponse>;
export declare type AtpAgentFetchHandler = (
httpUri: string,
httpMethod: string,
httpHeaders: AtpAgentFetchHeaders,
httpReqBody: any,
) => Promise<AtpAgentFetchHandlerResponse>
export interface AtpAgentGlobalOpts {
fetch: AtpAgentFetchHandler;
fetch: AtpAgentFetchHandler
}
export {};
export {}

@@ -29,4 +29,12 @@ # Moderation API

// the user's labeler settings
labelerSettings: [
// the global label settings (used on self-labels)
labels: {
porn: 'hide',
sexual: 'warn',
nudity: 'ignore',
// ...
},
// the per-labeler settings
labelers: [
{

@@ -37,3 +45,3 @@ labeler: {

},
settings: {
labels: {
porn: 'hide',

@@ -55,3 +63,4 @@ sexual: 'warn',

adultContentEnabled: boolean
labelerSettings: LabelerSettings[]
labels: Record<string, LabelPreference>
labelers: LabelerSettings[]
}

@@ -68,3 +77,3 @@

labeler: Labeler
settings: Record<string, LabelPreference>
labels: Record<string, LabelPreference>
}

@@ -71,0 +80,0 @@ ```

{
"name": "@atproto/api",
"version": "0.5.4",
"version": "0.5.5",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "scripts": {

@@ -225,4 +225,12 @@ # ATP API

// the user's labeler settings
labelerSettings: [
// the global label settings (used on self-labels)
labels: {
porn: 'hide',
sexual: 'warn',
nudity: 'ignore',
// ...
},
// the per-labeler settings
labelers: [
{

@@ -233,3 +241,3 @@ labeler: {

},
settings: {
labels: {
porn: 'hide',

@@ -236,0 +244,0 @@ sexual: 'warn',

@@ -8,2 +8,3 @@ /**

import { CID } from 'multiformats/cid'
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'

@@ -15,2 +16,5 @@ export interface Record {

banner?: BlobRef
labels?:
| ComAtprotoLabelDefs.SelfLabels
| { $type: string; [k: string]: unknown }
[k: string]: unknown

@@ -17,0 +21,0 @@ }

@@ -9,2 +9,3 @@ /**

import * as AppBskyRichtextFacet from '../richtext/facet'
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'

@@ -17,2 +18,5 @@ export interface Record {

avatar?: BlobRef
labels?:
| ComAtprotoLabelDefs.SelfLabels
| { $type: string; [k: string]: unknown }
createdAt: string

@@ -19,0 +23,0 @@ [k: string]: unknown

@@ -15,2 +15,7 @@ /**

cursor?: string
filter?:
| 'posts_with_replies'
| 'posts_no_replies'
| 'posts_with_media'
| (string & {})
}

@@ -17,0 +22,0 @@

@@ -13,2 +13,3 @@ /**

import * as AppBskyEmbedRecordWithMedia from '../embed/recordWithMedia'
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'

@@ -29,2 +30,5 @@

langs?: string[]
labels?:
| ComAtprotoLabelDefs.SelfLabels
| { $type: string; [k: string]: unknown }
createdAt: string

@@ -31,0 +35,0 @@ [k: string]: unknown

@@ -10,2 +10,3 @@ /**

import * as AppBskyRichtextFacet from '../richtext/facet'
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'

@@ -18,2 +19,5 @@ export interface Record {

avatar?: BlobRef
labels?:
| ComAtprotoLabelDefs.SelfLabels
| { $type: string; [k: string]: unknown }
createdAt: string

@@ -20,0 +24,0 @@ [k: string]: unknown

@@ -37,1 +37,38 @@ /**

}
/** Metadata tags on an atproto record, published by the author within the record. */
export interface SelfLabels {
values: SelfLabel[]
[k: string]: unknown
}
export function isSelfLabels(v: unknown): v is SelfLabels {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.label.defs#selfLabels'
)
}
export function validateSelfLabels(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.label.defs#selfLabels', v)
}
/** Metadata tag on an atproto record, published by the author within the record. Note -- schemas should use #selfLabels, not #selfLabel. */
export interface SelfLabel {
/** the short string name of the value or type of this label */
val: string
[k: string]: unknown
}
export function isSelfLabel(v: unknown): v is SelfLabel {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.label.defs#selfLabel'
)
}
export function validateSelfLabel(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.label.defs#selfLabel', v)
}

@@ -50,12 +50,12 @@ import { AppBskyGraphDefs } from '../client/index'

// look up the label preference
// TODO use the find() when 3P labelers support lands
// const labelerSettings = opts.labelerSettings.find(
// (s) => s.labeler.did === label.src,
// )
const labelerSettings = opts.labelerSettings[0]
if (!labelerSettings) {
// ignore labels from labelers we don't use
return
}
const isSelf = label.src === this.did
const labeler = isSelf
? undefined
: opts.labelers.find((s) => s.labeler.did === label.src)
/* TODO when 3P labelers are supported
if (!isSelf && !labeler) {
return // skip labelers not configured by the user
}*/
// establish the label preference for interpretation

@@ -67,4 +67,6 @@ let labelPref: LabelPreference = 'ignore'

labelPref = 'hide'
} else if (labelerSettings.settings[label.val]) {
labelPref = labelerSettings.settings[label.val]
} else if (labeler?.labels[label.val]) {
labelPref = labeler.labels[label.val]
} else if (opts.labels[label.val]) {
labelPref = opts.labels[label.val]
}

@@ -93,5 +95,8 @@

type: 'label',
source:
isSelf || !labeler
? { type: 'user' }
: { type: 'labeler', labeler: labeler.labeler },
label,
labelDef,
labeler: labelerSettings.labeler,
setting: labelPref,

@@ -98,0 +103,0 @@ priority,

@@ -67,3 +67,3 @@ import {

labeler: Labeler
settings: Record<string, LabelPreference>
labels: Record<string, LabelPreference>
}

@@ -99,2 +99,3 @@

| { type: 'list'; list: AppBskyGraphDefs.ListViewBasic }
| { type: 'labeler'; labeler: Labeler }

@@ -106,3 +107,3 @@ export type ModerationCause =

type: 'label'
labeler: Labeler
source: ModerationCauseSource
label: Label

@@ -118,3 +119,4 @@ labelDef: LabelDefinition

adultContentEnabled: boolean
labelerSettings: LabelerSettings[]
labels: Record<string, LabelPreference>
labelers: LabelerSettings[]
}

@@ -121,0 +123,0 @@

@@ -169,3 +169,4 @@ import { ModerationUI, ModerationOpts, ComAtprotoLabelDefs } from '../../src'

),
labelerSettings: [
labels: this.suite.configurations[scenario.cfg].settings,
labelers: [
{

@@ -176,3 +177,3 @@ labeler: {

},
settings: this.suite.configurations[scenario.cfg].settings,
labels: this.suite.configurations[scenario.cfg].settings,
},

@@ -179,0 +180,0 @@ ],

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc