This repository was archived by the owner on Aug 10, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed
Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 1+ import dotenv from 'dotenv'
2+ import { AtpAgent , BlobRef } from '@atproto/api'
3+
4+ const run = async ( ) => {
5+ dotenv . config ( )
6+ let config = require ( "./config.json" ) ;
7+ const handle = `${ process . env . BLUESKY_HANDLE } `
8+ const password = `${ process . env . BLUESKY_APP_PASSWORD } `
9+ const recordName = `${ process . env . RECORD_NAME } `
10+
11+ // only update this if in a test environment
12+ const agent = new AtpAgent ( { service : 'https://bsky.social' } )
13+ await agent . login ( { identifier : handle , password } )
14+
15+ try {
16+ await agent . api . app . bsky . feed . describeFeedGenerator ( )
17+ } catch ( err ) {
18+ throw new Error (
19+ 'The bluesky server is not ready to accept published custom feeds yet' ,
20+ )
21+ }
22+
23+ let record = {
24+ repo : agent . session ?. did ?? '' ,
25+ collection : 'app.bsky.feed.generator' ,
26+ rkey : recordName ,
27+ }
28+ let recordJSON = JSON . stringify ( record , null , 2 ) ;
29+ console . log ( `Deleting record ${ recordJSON } ` )
30+ let response = await agent . api . com . atproto . repo . deleteRecord ( record ) ;
31+ console . log ( `Result ${ response } ` )
32+ }
33+
34+ run ( )
Original file line number Diff line number Diff line change 99 "license" : " MIT" ,
1010 "scripts" : {
1111 "publishFeedGenerator" : " ts-node publishFeedGenerator.ts" ,
12- "deleteFeed " : " ts-node deleteFeed .ts"
12+ "deleteFeedGenerator " : " ts-node deleteFeedGenerator .ts"
1313 },
1414 "dependencies" : {
1515 "@atproto/api" : " ^0.3.7" ,
You can’t perform that action at this time.
0 commit comments