JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 13603
  • Score
    100M100P100Q148290F
  • License 0BSD

AT Protocol (com.atproto.*) schema definitions

Package Exports

  • @atcute/atproto
  • @atcute/atproto/types/admin/defs
  • @atcute/atproto/types/admin/deleteAccount
  • @atcute/atproto/types/admin/disableAccountInvites
  • @atcute/atproto/types/admin/disableInviteCodes
  • @atcute/atproto/types/admin/enableAccountInvites
  • @atcute/atproto/types/admin/getAccountInfo
  • @atcute/atproto/types/admin/getAccountInfos
  • @atcute/atproto/types/admin/getInviteCodes
  • @atcute/atproto/types/admin/getSubjectStatus
  • @atcute/atproto/types/admin/searchAccounts
  • @atcute/atproto/types/admin/sendEmail
  • @atcute/atproto/types/admin/updateAccountEmail
  • @atcute/atproto/types/admin/updateAccountHandle
  • @atcute/atproto/types/admin/updateAccountPassword
  • @atcute/atproto/types/admin/updateAccountSigningKey
  • @atcute/atproto/types/admin/updateSubjectStatus
  • @atcute/atproto/types/identity/defs
  • @atcute/atproto/types/identity/getRecommendedDidCredentials
  • @atcute/atproto/types/identity/refreshIdentity
  • @atcute/atproto/types/identity/requestPlcOperationSignature
  • @atcute/atproto/types/identity/resolveDid
  • @atcute/atproto/types/identity/resolveHandle
  • @atcute/atproto/types/identity/resolveIdentity
  • @atcute/atproto/types/identity/signPlcOperation
  • @atcute/atproto/types/identity/submitPlcOperation
  • @atcute/atproto/types/identity/updateHandle
  • @atcute/atproto/types/label/defs
  • @atcute/atproto/types/label/queryLabels
  • @atcute/atproto/types/label/subscribeLabels
  • @atcute/atproto/types/lexicon/schema
  • @atcute/atproto/types/moderation/createReport
  • @atcute/atproto/types/moderation/defs
  • @atcute/atproto/types/repo/applyWrites
  • @atcute/atproto/types/repo/createRecord
  • @atcute/atproto/types/repo/defs
  • @atcute/atproto/types/repo/deleteRecord
  • @atcute/atproto/types/repo/describeRepo
  • @atcute/atproto/types/repo/getRecord
  • @atcute/atproto/types/repo/importRepo
  • @atcute/atproto/types/repo/listMissingBlobs
  • @atcute/atproto/types/repo/listRecords
  • @atcute/atproto/types/repo/putRecord
  • @atcute/atproto/types/repo/strongRef
  • @atcute/atproto/types/repo/uploadBlob
  • @atcute/atproto/types/server/activateAccount
  • @atcute/atproto/types/server/checkAccountStatus
  • @atcute/atproto/types/server/confirmEmail
  • @atcute/atproto/types/server/createAccount
  • @atcute/atproto/types/server/createAppPassword
  • @atcute/atproto/types/server/createInviteCode
  • @atcute/atproto/types/server/createInviteCodes
  • @atcute/atproto/types/server/createSession
  • @atcute/atproto/types/server/deactivateAccount
  • @atcute/atproto/types/server/defs
  • @atcute/atproto/types/server/deleteAccount
  • @atcute/atproto/types/server/deleteSession
  • @atcute/atproto/types/server/describeServer
  • @atcute/atproto/types/server/getAccountInviteCodes
  • @atcute/atproto/types/server/getServiceAuth
  • @atcute/atproto/types/server/getSession
  • @atcute/atproto/types/server/listAppPasswords
  • @atcute/atproto/types/server/refreshSession
  • @atcute/atproto/types/server/requestAccountDelete
  • @atcute/atproto/types/server/requestEmailConfirmation
  • @atcute/atproto/types/server/requestEmailUpdate
  • @atcute/atproto/types/server/requestPasswordReset
  • @atcute/atproto/types/server/reserveSigningKey
  • @atcute/atproto/types/server/resetPassword
  • @atcute/atproto/types/server/revokeAppPassword
  • @atcute/atproto/types/server/updateEmail
  • @atcute/atproto/types/sync/defs
  • @atcute/atproto/types/sync/getBlob
  • @atcute/atproto/types/sync/getBlocks
  • @atcute/atproto/types/sync/getCheckout
  • @atcute/atproto/types/sync/getHead
  • @atcute/atproto/types/sync/getHostStatus
  • @atcute/atproto/types/sync/getLatestCommit
  • @atcute/atproto/types/sync/getRecord
  • @atcute/atproto/types/sync/getRepo
  • @atcute/atproto/types/sync/getRepoStatus
  • @atcute/atproto/types/sync/listBlobs
  • @atcute/atproto/types/sync/listHosts
  • @atcute/atproto/types/sync/listRepos
  • @atcute/atproto/types/sync/listReposByCollection
  • @atcute/atproto/types/sync/notifyOfUpdate
  • @atcute/atproto/types/sync/requestCrawl
  • @atcute/atproto/types/sync/subscribeRepos
  • @atcute/atproto/types/temp/addReservedHandle
  • @atcute/atproto/types/temp/checkHandleAvailability
  • @atcute/atproto/types/temp/checkSignupQueue
  • @atcute/atproto/types/temp/dereferenceScope
  • @atcute/atproto/types/temp/fetchLabels
  • @atcute/atproto/types/temp/requestPhoneVerification
  • @atcute/atproto/types/temp/revokeAccountCredentials

Readme

@atcute/atproto

AT Protocol (com.atproto.*) schema definitions

usage

import { ComAtprotoLabelDefs } from '@atcute/atproto';
import { is } from '@atcute/lexicons';

const label: ComAtprotoLabelDefs.Label = {
    cts: '2024-11-13T04:46:40.254Z',
    neg: false,
    src: 'did:plc:wkoofae5uytcm7bjncmev6n6',
    uri: 'did:plc:ia76kvnndjutgedggx2ibrem',
    val: 'she-it',
    ver: 1,
};

is(ComAtprotoLabelDefs.labelSchema, label);
// -> true

with @atcute/client

pick either one of these 3 options to register the ambient declarations

// file: tsconfig.json
{
    "compilerOptions": {
        "types": ["@atcute/atproto"],
    },
}
// file: env.d.ts
/// <reference types="@atcute/atproto" />
// file: index.ts
import type {} from '@atcute/atproto';

now all the XRPC operations should be visible in the client

import { Client, simpleFetchHandler } from '@atcute/client';

const client = new Client({ handler: simpleFetchHandler({ service: 'https://bsky.social' }) });

const response = await client.get('com.atproto.server.describeServer');
// ...

with @atcute/lex-cli

when building your own lexicons that reference AT Protocol types, configure lex-cli to import from this package:

// file: lex.config.js
import { defineLexiconConfig } from '@atcute/lex-cli';

export default defineLexiconConfig({
    files: ['lexicons/**/*.json'],
    outdir: 'src/lexicons/',
    mappings: [
        {
            nsid: ['com.atproto.*'],
            imports: (nsid) => {
                const specifier = nsid.slice('com.atproto.'.length).replaceAll('.', '/');
                return { type: 'namespace', from: `@atcute/atproto/types/${specifier}` };
            },
        },
    ],
});