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
164
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.6.7 to 0.6.8

dist/client/types/app/bsky/actor/createScene.d.ts

8

build.js

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

const pkgJson = require('@npmcli/package-json')
const { nodeExternalsPlugin } = require('esbuild-node-externals')

@@ -6,2 +7,9 @@

if (process.argv.includes('--update-main-to-dist')) {
return pkgJson
.load(__dirname)
.then((pkg) => pkg.update({ main: 'dist/index.js' }))
.then((pkg) => pkg.save())
}
require('esbuild').build({

@@ -8,0 +16,0 @@ logLevel: 'info',

69

dist/agent.d.ts

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

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;
}
import { AtpAgent } from './agent';
import { AppBskyFeedPost, AppBskyActorProfile } from './client';
import { BskyPreferences, BskyLabelPreference } from './types';
export declare class BskyAgent extends AtpAgent {

@@ -46,2 +47,25 @@ get app(): import("./client").AppNS;

updateSeenNotifications(seenAt?: string): Promise<import("./client/types/app/bsky/notification/updateSeen").Response>;
getPreferences(): Promise<BskyPreferences>;
setSavedFeeds(saved: string[], pinned: string[]): Promise<{
saved: string[];
pinned: string[];
}>;
addSavedFeed(v: string): Promise<{
saved: string[];
pinned: string[];
}>;
removeSavedFeed(v: string): Promise<{
saved: string[];
pinned: string[];
}>;
addPinnedFeed(v: string): Promise<{
saved: string[];
pinned: string[];
}>;
removePinnedFeed(v: string): Promise<{
saved: string[];
pinned: string[];
}>;
setAdultContentEnabled(v: boolean): Promise<void>;
setContentLabelPref(key: string, value: BskyLabelPreference): Promise<void>;
}

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

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;

@@ -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,30 +0,24 @@

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,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,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;

@@ -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,34 +0,30 @@

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;

@@ -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,16 +0,7 @@

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,5 +0,2 @@

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>;

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

export { AtUri } from '@atproto/uri';
export { AtUri } from '@atproto/syntax';
export { BlobRef, lexToJson, stringifyLex, jsonToLex, jsonStringToLex, } from '@atproto/lexicon';

@@ -3,0 +3,0 @@ export { parseLanguage } from '@atproto/common-web';

@@ -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,7 +0,4 @@

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,46 +0,44 @@

export declare type AtpSessionEvent =
| 'create'
| 'create-failed'
| 'update'
| 'expired'
import { LabelPreference } from './moderation/types';
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 declare type BskyLabelPreference = LabelPreference | 'show';
export interface BskyPreferences {
feeds: {
saved?: string[];
pinned?: string[];
};
adultContentEnabled: boolean;
contentLabels: Record<string, BskyLabelPreference>;
}
export {};
{
"name": "@atproto/api",
"version": "0.6.7",
"version": "0.6.8",
"main": "dist/index.js",
"scripts": {
"codegen": "yarn docgen && node ./scripts/generate-code.mjs && lex gen-api ./src/client ../../lexicons/com/atproto/*/* ../../lexicons/app/bsky/*/*",
"docgen": "node ./scripts/generate-docs.mjs",
"build": "node ./build.js",
"postbuild": "tsc --build tsconfig.build.json",
"update-main-to-dist": "node ./update-pkg.js --update-main-to-dist",
"update-main-to-src": "node ./update-pkg.js --update-main-to-src",
"prepublish": "npm run update-main-to-dist",
"postpublish": "npm run update-main-to-src",
"test": "jest",
"bench": "jest --config jest.bench.config.js",
"bench:profile": "node --inspect-brk ../../node_modules/.bin/jest --config jest.bench.config.js"
},
"license": "MIT",

@@ -12,25 +25,13 @@ "repository": {

"dependencies": {
"multiformats": "^9.9.0",
"@atproto/common-web": "*",
"@atproto/syntax": "*",
"@atproto/xrpc": "*",
"tlds": "^1.234.0",
"typed-emitter": "^2.1.0",
"@atproto/common-web": "^0.2.0",
"@atproto/lexicon": "^0.2.0",
"@atproto/uri": "^0.1.0",
"@atproto/xrpc": "^0.2.0"
"typed-emitter": "^2.1.0"
},
"devDependencies": {
"common-tags": "^1.8.2",
"@atproto/lex-cli": "^0.2.0",
"@atproto/pds": "^0.1.12"
},
"scripts": {
"codegen": "pnpm docgen && node ./scripts/generate-code.mjs && lex gen-api ./src/client ../../lexicons/com/atproto/*/* ../../lexicons/app/bsky/*/*",
"docgen": "node ./scripts/generate-docs.mjs",
"build": "node ./build.js",
"postbuild": "tsc --build tsconfig.build.json",
"test": "jest",
"bench": "jest --config jest.bench.config.js",
"bench:profile": "node --inspect-brk ../../node_modules/.bin/jest --config jest.bench.config.js"
},
"types": "dist/index.d.ts"
}
"@atproto/lex-cli": "*",
"@atproto/pds": "*",
"common-tags": "^1.8.2"
}
}

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

import { AtUri } from '@atproto/uri'
import { AtUri } from '@atproto/syntax'
import { AtpAgent } from './agent'

@@ -6,4 +6,6 @@ import {

AppBskyActorProfile,
AppBskyActorDefs,
ComAtprotoRepoPutRecord,
} from './client'
import { BskyPreferences, BskyLabelPreference } from './types'

@@ -240,2 +242,180 @@ export class BskyAgent extends AtpAgent {

}
async getPreferences(): Promise<BskyPreferences> {
const prefs: BskyPreferences = {
feeds: {
saved: undefined,
pinned: undefined,
},
adultContentEnabled: false,
contentLabels: {},
}
const res = await this.app.bsky.actor.getPreferences({})
for (const pref of res.data.preferences) {
if (
AppBskyActorDefs.isAdultContentPref(pref) &&
AppBskyActorDefs.validateAdultContentPref(pref).success
) {
prefs.adultContentEnabled = pref.enabled
} else if (
AppBskyActorDefs.isContentLabelPref(pref) &&
AppBskyActorDefs.validateAdultContentPref(pref).success
) {
let value = pref.visibility
if (value === 'show') {
value = 'ignore'
}
if (value === 'ignore' || value === 'warn' || value === 'hide') {
prefs.contentLabels[pref.label] = value as BskyLabelPreference
}
} else if (
AppBskyActorDefs.isSavedFeedsPref(pref) &&
AppBskyActorDefs.validateSavedFeedsPref(pref).success
) {
prefs.feeds.saved = pref.saved
prefs.feeds.pinned = pref.pinned
}
}
return prefs
}
async setSavedFeeds(saved: string[], pinned: string[]) {
return updateFeedPreferences(this, () => ({
saved,
pinned,
}))
}
async addSavedFeed(v: string) {
return updateFeedPreferences(this, (saved: string[], pinned: string[]) => ({
saved: [...saved.filter((uri) => uri !== v), v],
pinned,
}))
}
async removeSavedFeed(v: string) {
return updateFeedPreferences(this, (saved: string[], pinned: string[]) => ({
saved: saved.filter((uri) => uri !== v),
pinned: pinned.filter((uri) => uri !== v),
}))
}
async addPinnedFeed(v: string) {
return updateFeedPreferences(this, (saved: string[], pinned: string[]) => ({
saved: [...saved.filter((uri) => uri !== v), v],
pinned: [...pinned.filter((uri) => uri !== v), v],
}))
}
async removePinnedFeed(v: string) {
return updateFeedPreferences(this, (saved: string[], pinned: string[]) => ({
saved,
pinned: pinned.filter((uri) => uri !== v),
}))
}
async setAdultContentEnabled(v: boolean) {
await updatePreferences(this, (prefs: AppBskyActorDefs.Preferences) => {
const existing = prefs.find(
(pref) =>
AppBskyActorDefs.isAdultContentPref(pref) &&
AppBskyActorDefs.validateAdultContentPref(pref).success,
)
if (existing) {
existing.enabled = v
} else {
prefs.push({
$type: 'app.bsky.actor.defs#adultContentPref',
enabled: v,
})
}
return prefs
})
}
async setContentLabelPref(key: string, value: BskyLabelPreference) {
// TEMP update old value
if (value === 'show') {
value = 'ignore'
}
await updatePreferences(this, (prefs: AppBskyActorDefs.Preferences) => {
const existing = prefs.find(
(pref) =>
AppBskyActorDefs.isContentLabelPref(pref) &&
AppBskyActorDefs.validateAdultContentPref(pref).success &&
pref.label === key,
)
if (existing) {
existing.visibility = value
} else {
prefs.push({
$type: 'app.bsky.actor.defs#contentLabelPref',
label: key,
visibility: value,
})
}
return prefs
})
}
}
/**
* This function updates the preferences of a user and allows for a callback function to be executed
* before the update.
* @param cb - cb is a callback function that takes in a single parameter of type
* AppBskyActorDefs.Preferences and returns either a boolean or void. This callback function is used to
* update the preferences of the user. The function is called with the current preferences as an
* argument and if the callback returns false, the preferences are not updated.
*/
async function updatePreferences(
agent: BskyAgent,
cb: (
prefs: AppBskyActorDefs.Preferences,
) => AppBskyActorDefs.Preferences | false,
) {
const res = await agent.app.bsky.actor.getPreferences({})
const newPrefs = cb(res.data.preferences)
if (newPrefs === false) {
return
}
await agent.app.bsky.actor.putPreferences({
preferences: newPrefs,
})
}
/**
* A helper specifically for updating feed preferences
*/
async function updateFeedPreferences(
agent: BskyAgent,
cb: (
saved: string[],
pinned: string[],
) => { saved: string[]; pinned: string[] },
): Promise<{ saved: string[]; pinned: string[] }> {
let res
await updatePreferences(agent, (prefs: AppBskyActorDefs.Preferences) => {
let feedsPref = prefs.find(
(pref) =>
AppBskyActorDefs.isSavedFeedsPref(pref) &&
AppBskyActorDefs.validateSavedFeedsPref(pref).success,
) as AppBskyActorDefs.SavedFeedsPref | undefined
if (feedsPref) {
res = cb(feedsPref.saved, feedsPref.pinned)
feedsPref.saved = res.saved
feedsPref.pinned = res.pinned
} else {
res = cb([], [])
feedsPref = {
$type: 'app.bsky.actor.defs#savedFeedsPref',
saved: res.saved,
pinned: res.pinned,
}
}
return prefs
.filter((pref) => !AppBskyActorDefs.isSavedFeedsPref(pref))
.concat([feedsPref])
})
return res
}

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

did: string
/** The commit to get the checkout from. Defaults to current HEAD. */
commit?: string
}

@@ -17,0 +15,0 @@

@@ -13,6 +13,4 @@ /**

did: string
/** The earliest commit in the commit range (not inclusive) */
earliest?: string
/** The latest commit in the commit range (inclusive) */
latest?: string
/** The revision of the repo to catch up from. */
since?: string
}

@@ -19,0 +17,0 @@

@@ -13,6 +13,6 @@ /**

did: string
/** The most recent commit */
latest?: string
/** The earliest commit to start from */
earliest?: string
/** Optional revision of the repo to list blobs since */
since?: string
limit?: number
cursor?: string
}

@@ -23,2 +23,3 @@

export interface OutputSchema {
cursor?: string
cids: string[]

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

@@ -16,3 +16,7 @@ /**

commit: CID
prev: CID | null
prev?: CID | null
/** The rev of the emitted commit */
rev: string
/** The rev of the last emitted commit from this repo */
since: string | null
/** CAR file containing relevant blocks */

@@ -19,0 +23,0 @@ blocks: Uint8Array

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

export { AtUri } from '@atproto/uri'
export { AtUri } from '@atproto/syntax'
export {

@@ -3,0 +3,0 @@ BlobRef,

@@ -0,1 +1,3 @@

import { LabelPreference } from './moderation/types'
/**

@@ -73,1 +75,19 @@ * Used by the PersistSessionHandler to indicate what change occurred

}
/**
* Content-label preference
*/
export type BskyLabelPreference = LabelPreference | 'show'
// TEMP we need to permanently convert 'show' to 'ignore', for now we manually convert -prf
/**
* Bluesky preferences object
*/
export interface BskyPreferences {
feeds: {
saved?: string[]
pinned?: string[]
}
adultContentEnabled: boolean
contentLabels: Record<string, BskyLabelPreference>
}

@@ -203,2 +203,151 @@ import {

})
describe('preferences methods', () => {
it('gets and sets preferences correctly', async () => {
const agent = new BskyAgent({ service: server.url })
await agent.createAccount({
handle: 'user5.test',
email: 'user5@test.com',
password: 'password',
})
await expect(agent.getPreferences()).resolves.toStrictEqual({
feeds: { pinned: undefined, saved: undefined },
adultContentEnabled: false,
contentLabels: {},
})
await agent.setAdultContentEnabled(true)
await expect(agent.getPreferences()).resolves.toStrictEqual({
feeds: { pinned: undefined, saved: undefined },
adultContentEnabled: true,
contentLabels: {},
})
await agent.setAdultContentEnabled(false)
await expect(agent.getPreferences()).resolves.toStrictEqual({
feeds: { pinned: undefined, saved: undefined },
adultContentEnabled: false,
contentLabels: {},
})
await agent.setContentLabelPref('impersonation', 'warn')
await expect(agent.getPreferences()).resolves.toStrictEqual({
feeds: { pinned: undefined, saved: undefined },
adultContentEnabled: false,
contentLabels: {
impersonation: 'warn',
},
})
await agent.setContentLabelPref('spam', 'show') // will convert to 'ignore'
await agent.setContentLabelPref('impersonation', 'hide')
await expect(agent.getPreferences()).resolves.toStrictEqual({
feeds: { pinned: undefined, saved: undefined },
adultContentEnabled: false,
contentLabels: {
impersonation: 'hide',
spam: 'ignore',
},
})
await agent.addSavedFeed('at://bob.com/app.bsky.feed.generator/fake')
await expect(agent.getPreferences()).resolves.toStrictEqual({
feeds: {
pinned: [],
saved: ['at://bob.com/app.bsky.feed.generator/fake'],
},
adultContentEnabled: false,
contentLabels: {
impersonation: 'hide',
spam: 'ignore',
},
})
await agent.addPinnedFeed('at://bob.com/app.bsky.feed.generator/fake')
await expect(agent.getPreferences()).resolves.toStrictEqual({
feeds: {
pinned: ['at://bob.com/app.bsky.feed.generator/fake'],
saved: ['at://bob.com/app.bsky.feed.generator/fake'],
},
adultContentEnabled: false,
contentLabels: {
impersonation: 'hide',
spam: 'ignore',
},
})
await agent.removePinnedFeed('at://bob.com/app.bsky.feed.generator/fake')
await expect(agent.getPreferences()).resolves.toStrictEqual({
feeds: {
pinned: [],
saved: ['at://bob.com/app.bsky.feed.generator/fake'],
},
adultContentEnabled: false,
contentLabels: {
impersonation: 'hide',
spam: 'ignore',
},
})
await agent.removeSavedFeed('at://bob.com/app.bsky.feed.generator/fake')
await expect(agent.getPreferences()).resolves.toStrictEqual({
feeds: {
pinned: [],
saved: [],
},
adultContentEnabled: false,
contentLabels: {
impersonation: 'hide',
spam: 'ignore',
},
})
await agent.addPinnedFeed('at://bob.com/app.bsky.feed.generator/fake')
await expect(agent.getPreferences()).resolves.toStrictEqual({
feeds: {
pinned: ['at://bob.com/app.bsky.feed.generator/fake'],
saved: ['at://bob.com/app.bsky.feed.generator/fake'],
},
adultContentEnabled: false,
contentLabels: {
impersonation: 'hide',
spam: 'ignore',
},
})
await agent.addPinnedFeed('at://bob.com/app.bsky.feed.generator/fake2')
await expect(agent.getPreferences()).resolves.toStrictEqual({
feeds: {
pinned: [
'at://bob.com/app.bsky.feed.generator/fake',
'at://bob.com/app.bsky.feed.generator/fake2',
],
saved: [
'at://bob.com/app.bsky.feed.generator/fake',
'at://bob.com/app.bsky.feed.generator/fake2',
],
},
adultContentEnabled: false,
contentLabels: {
impersonation: 'hide',
spam: 'ignore',
},
})
await agent.removeSavedFeed('at://bob.com/app.bsky.feed.generator/fake')
await expect(agent.getPreferences()).resolves.toStrictEqual({
feeds: {
pinned: ['at://bob.com/app.bsky.feed.generator/fake2'],
saved: ['at://bob.com/app.bsky.feed.generator/fake2'],
},
adultContentEnabled: false,
contentLabels: {
impersonation: 'hide',
spam: 'ignore',
},
})
})
})
})

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 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