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.6.6 to 0.6.7

LICENSE

8

build.js

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

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

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

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

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

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

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

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

@@ -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 {}
{
"name": "@atproto/api",
"version": "0.6.6",
"version": "0.6.7",
"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",

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

"dependencies": {
"@atproto/common-web": "*",
"@atproto/uri": "*",
"@atproto/xrpc": "*",
"multiformats": "^9.9.0",
"tlds": "^1.234.0",
"typed-emitter": "^2.1.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"
},
"devDependencies": {
"@atproto/lex-cli": "*",
"@atproto/pds": "*",
"common-tags": "^1.8.2"
}
}
"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"
}

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