Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
dholms committed Sep 25, 2023
1 parent 967c3a7 commit 16c950f
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 340 deletions.
23 changes: 0 additions & 23 deletions lexicons/app/bsky/unspecced/applyLabels.json

This file was deleted.

13 changes: 0 additions & 13 deletions packages/api/src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ import * as AppBskyNotificationListNotifications from './types/app/bsky/notifica
import * as AppBskyNotificationRegisterPush from './types/app/bsky/notification/registerPush'
import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen'
import * as AppBskyRichtextFacet from './types/app/bsky/richtext/facet'
import * as AppBskyUnspeccedApplyLabels from './types/app/bsky/unspecced/applyLabels'
import * as AppBskyUnspeccedGetPopular from './types/app/bsky/unspecced/getPopular'
import * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators'
import * as AppBskyUnspeccedGetTimelineSkeleton from './types/app/bsky/unspecced/getTimelineSkeleton'
Expand Down Expand Up @@ -254,7 +253,6 @@ export * as AppBskyNotificationListNotifications from './types/app/bsky/notifica
export * as AppBskyNotificationRegisterPush from './types/app/bsky/notification/registerPush'
export * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen'
export * as AppBskyRichtextFacet from './types/app/bsky/richtext/facet'
export * as AppBskyUnspeccedApplyLabels from './types/app/bsky/unspecced/applyLabels'
export * as AppBskyUnspeccedGetPopular from './types/app/bsky/unspecced/getPopular'
export * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators'
export * as AppBskyUnspeccedGetTimelineSkeleton from './types/app/bsky/unspecced/getTimelineSkeleton'
Expand Down Expand Up @@ -2234,17 +2232,6 @@ export class UnspeccedNS {
this._service = service
}

applyLabels(
data?: AppBskyUnspeccedApplyLabels.InputSchema,
opts?: AppBskyUnspeccedApplyLabels.CallOptions,
): Promise<AppBskyUnspeccedApplyLabels.Response> {
return this._service.xrpc
.call('app.bsky.unspecced.applyLabels', opts?.qp, data, opts)
.catch((e) => {
throw AppBskyUnspeccedApplyLabels.toKnownErr(e)
})
}

getPopular(
params?: AppBskyUnspeccedGetPopular.QueryParams,
opts?: AppBskyUnspeccedGetPopular.CallOptions,
Expand Down
27 changes: 0 additions & 27 deletions packages/api/src/client/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6829,32 +6829,6 @@ export const schemaDict = {
},
},
},
AppBskyUnspeccedApplyLabels: {
lexicon: 1,
id: 'app.bsky.unspecced.applyLabels',
defs: {
main: {
type: 'procedure',
description: 'Allow a labeler to apply labels directly.',
input: {
encoding: 'application/json',
schema: {
type: 'object',
required: ['labels'],
properties: {
labels: {
type: 'array',
items: {
type: 'ref',
ref: 'lex:com.atproto.label.defs#label',
},
},
},
},
},
},
},
},
AppBskyUnspeccedGetPopular: {
lexicon: 1,
id: 'app.bsky.unspecced.getPopular',
Expand Down Expand Up @@ -7130,7 +7104,6 @@ export const ids = {
AppBskyNotificationRegisterPush: 'app.bsky.notification.registerPush',
AppBskyNotificationUpdateSeen: 'app.bsky.notification.updateSeen',
AppBskyRichtextFacet: 'app.bsky.richtext.facet',
AppBskyUnspeccedApplyLabels: 'app.bsky.unspecced.applyLabels',
AppBskyUnspeccedGetPopular: 'app.bsky.unspecced.getPopular',
AppBskyUnspeccedGetPopularFeedGenerators:
'app.bsky.unspecced.getPopularFeedGenerators',
Expand Down
33 changes: 0 additions & 33 deletions packages/api/src/client/types/app/bsky/unspecced/applyLabels.ts

This file was deleted.

18 changes: 1 addition & 17 deletions packages/bsky/src/auto-moderator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,28 +280,12 @@ export class AutoModerator {
async storeLabels(uri: AtUri, cid: CID, labels: string[]): Promise<void> {
if (labels.length < 1) return
const labelSrvc = this.services.label(this.ctx.db)
const formatted = await labelSrvc.formatAndCreate(
await labelSrvc.formatAndCreate(
this.ctx.cfg.labelerDid,
uri.toString(),
cid.toString(),
{ create: labels },
)
if (this.pushAgent) {
const agent = this.pushAgent
try {
await agent.api.app.bsky.unspecced.applyLabels({ labels: formatted })
} catch (err) {
log.error(
{
err,
uri: uri.toString(),
labels,
receiver: agent.service.toString(),
},
'failed to push labels',
)
}
}
}

async processAll() {
Expand Down
12 changes: 0 additions & 12 deletions packages/bsky/src/lexicon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ import * as AppBskyNotificationGetUnreadCount from './types/app/bsky/notificatio
import * as AppBskyNotificationListNotifications from './types/app/bsky/notification/listNotifications'
import * as AppBskyNotificationRegisterPush from './types/app/bsky/notification/registerPush'
import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen'
import * as AppBskyUnspeccedApplyLabels from './types/app/bsky/unspecced/applyLabels'
import * as AppBskyUnspeccedGetPopular from './types/app/bsky/unspecced/getPopular'
import * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators'
import * as AppBskyUnspeccedGetTimelineSkeleton from './types/app/bsky/unspecced/getTimelineSkeleton'
Expand Down Expand Up @@ -1388,17 +1387,6 @@ export class UnspeccedNS {
this._server = server
}

applyLabels<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
AppBskyUnspeccedApplyLabels.Handler<ExtractAuth<AV>>,
AppBskyUnspeccedApplyLabels.HandlerReqCtx<ExtractAuth<AV>>
>,
) {
const nsid = 'app.bsky.unspecced.applyLabels' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}

getPopular<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
Expand Down
27 changes: 0 additions & 27 deletions packages/bsky/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6829,32 +6829,6 @@ export const schemaDict = {
},
},
},
AppBskyUnspeccedApplyLabels: {
lexicon: 1,
id: 'app.bsky.unspecced.applyLabels',
defs: {
main: {
type: 'procedure',
description: 'Allow a labeler to apply labels directly.',
input: {
encoding: 'application/json',
schema: {
type: 'object',
required: ['labels'],
properties: {
labels: {
type: 'array',
items: {
type: 'ref',
ref: 'lex:com.atproto.label.defs#label',
},
},
},
},
},
},
},
},
AppBskyUnspeccedGetPopular: {
lexicon: 1,
id: 'app.bsky.unspecced.getPopular',
Expand Down Expand Up @@ -7130,7 +7104,6 @@ export const ids = {
AppBskyNotificationRegisterPush: 'app.bsky.notification.registerPush',
AppBskyNotificationUpdateSeen: 'app.bsky.notification.updateSeen',
AppBskyRichtextFacet: 'app.bsky.richtext.facet',
AppBskyUnspeccedApplyLabels: 'app.bsky.unspecced.applyLabels',
AppBskyUnspeccedGetPopular: 'app.bsky.unspecced.getPopular',
AppBskyUnspeccedGetPopularFeedGenerators:
'app.bsky.unspecced.getPopularFeedGenerators',
Expand Down
39 changes: 0 additions & 39 deletions packages/bsky/src/lexicon/types/app/bsky/unspecced/applyLabels.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/dev-env/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const buildShallow =

require('esbuild').build({
logLevel: 'info',
entryPoints: ['src/index.ts', 'src/bin.ts', 'src/bin-network.ts'],
entryPoints: ['src/index.ts', 'src/bin.ts'],
bundle: true,
sourcemap: true,
outdir: 'dist',
Expand Down
3 changes: 1 addition & 2 deletions packages/dev-env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"build": "node ./build.js",
"postbuild": "tsc --build tsconfig.build.json",
"update-main-to-dist": "node ../../update-main-to-dist.js packages/dev-env",
"start": "node dist/bin.js",
"start:network": "../dev-infra/with-test-redis-and-db.sh node dist/bin-network.js"
"start": "../dev-infra/with-test-redis-and-db.sh node dist/bin.js"
},
"dependencies": {
"@atproto/api": "workspace:^",
Expand Down
40 changes: 0 additions & 40 deletions packages/dev-env/src/bin-network.ts

This file was deleted.

9 changes: 7 additions & 2 deletions packages/dev-env/src/bin.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { generateMockSetup } from './mock'
import { TestNetworkNoAppView } from './network-no-appview'
import { TestNetwork } from './network'

const run = async () => {
console.log(`
Expand All @@ -12,10 +12,14 @@ const run = async () => {
[ created by Bluesky ]`)

const network = await TestNetworkNoAppView.create({
const network = await TestNetwork.create({
pds: {
port: 2583,
publicUrl: 'http://localhost:2583',
dbPostgresSchema: 'pds',
},
bsky: {
dbPostgresSchema: 'bsky',
},
plc: { port: 2582 },
})
Expand All @@ -27,6 +31,7 @@ const run = async () => {
console.log(
`🌞 Personal Data server started http://localhost:${network.pds.port}`,
)
console.log(`🌅 Bsky Appview started http://localhost:${network.bsky.port}`)
for (const fg of network.feedGens) {
console.log(`🤖 Feed Generator started http://localhost:${fg.port}`)
}
Expand Down
Loading

0 comments on commit 16c950f

Please sign in to comment.