@atproto/bsky 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/api/com/atproto/admin/util.d.ts +5 -0
- package/dist/context.d.ts +6 -1
- package/dist/db/index.js +51 -2
- package/dist/db/index.js.map +3 -3
- package/dist/db/migrations/20230929T192920807Z-record-cursor-indexes.d.ts +3 -0
- package/dist/db/migrations/index.d.ts +1 -0
- package/dist/did-cache.d.ts +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1381 -530
- package/dist/index.js.map +3 -3
- package/dist/lexicon/index.d.ts +8 -0
- package/dist/lexicon/lexicons.d.ts +231 -3
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/admin/defs.d.ts +28 -0
- package/dist/lexicon/types/com/atproto/admin/getAccountInfo.d.ts +29 -0
- package/dist/lexicon/types/com/atproto/admin/getSubjectStatus.d.ts +39 -0
- package/dist/lexicon/types/com/atproto/admin/searchRepos.d.ts +0 -1
- package/dist/lexicon/types/com/atproto/admin/updateSubjectStatus.d.ts +46 -0
- package/dist/lexicon/types/com/atproto/server/createAccount.d.ts +2 -0
- package/dist/lexicon/types/com/atproto/server/createSession.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/server/refreshSession.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/server/reserveSigningKey.d.ts +30 -0
- package/dist/lexicon/types/com/atproto/sync/listRepos.d.ts +1 -0
- package/dist/services/actor/types.d.ts +1 -0
- package/dist/services/graph/index.d.ts +2 -0
- package/dist/services/moderation/index.d.ts +13 -3
- package/package.json +13 -14
- package/src/api/app/bsky/feed/getAuthorFeed.ts +2 -2
- package/src/api/app/bsky/feed/getPostThread.ts +2 -2
- package/src/api/app/bsky/notification/listNotifications.ts +33 -22
- package/src/api/com/atproto/admin/getModerationAction.ts +28 -2
- package/src/api/com/atproto/admin/getModerationReport.ts +27 -2
- package/src/api/com/atproto/admin/getRecord.ts +14 -2
- package/src/api/com/atproto/admin/getRepo.ts +13 -2
- package/src/api/com/atproto/admin/reverseModerationAction.ts +31 -5
- package/src/api/com/atproto/admin/searchRepos.ts +2 -5
- package/src/api/com/atproto/admin/takeModerationAction.ts +41 -7
- package/src/api/com/atproto/admin/util.ts +50 -0
- package/src/api/well-known.ts +8 -0
- package/src/auth.ts +12 -5
- package/src/auto-moderator/index.ts +1 -0
- package/src/context.ts +25 -1
- package/src/db/migrations/20230929T192920807Z-record-cursor-indexes.ts +40 -0
- package/src/db/migrations/index.ts +1 -0
- package/src/did-cache.ts +29 -14
- package/src/feed-gen/with-friends.ts +2 -2
- package/src/index.ts +4 -1
- package/src/indexer/subscription.ts +1 -21
- package/src/lexicon/index.ts +48 -0
- package/src/lexicon/lexicons.ts +246 -4
- package/src/lexicon/types/app/bsky/actor/defs.ts +1 -0
- package/src/lexicon/types/com/atproto/admin/defs.ts +61 -0
- package/src/lexicon/types/com/atproto/admin/getAccountInfo.ts +41 -0
- package/src/lexicon/types/com/atproto/admin/getSubjectStatus.ts +54 -0
- package/src/lexicon/types/com/atproto/admin/searchRepos.ts +0 -1
- package/src/lexicon/types/com/atproto/admin/updateSubjectStatus.ts +61 -0
- package/src/lexicon/types/com/atproto/server/createAccount.ts +2 -0
- package/src/lexicon/types/com/atproto/server/createSession.ts +1 -0
- package/src/lexicon/types/com/atproto/server/refreshSession.ts +1 -0
- package/src/lexicon/types/com/atproto/server/reserveSigningKey.ts +44 -0
- package/src/lexicon/types/com/atproto/sync/listRepos.ts +1 -0
- package/src/logger.ts +8 -0
- package/src/services/actor/index.ts +7 -1
- package/src/services/actor/types.ts +1 -0
- package/src/services/actor/views.ts +26 -8
- package/src/services/graph/index.ts +26 -7
- package/src/services/indexing/index.ts +15 -17
- package/src/services/moderation/index.ts +94 -14
- package/src/services/moderation/views.ts +1 -0
- package/tests/__snapshots__/feed-generation.test.ts.snap +12 -12
- package/tests/__snapshots__/indexing.test.ts.snap +4 -4
- package/tests/admin/__snapshots__/get-moderation-action.test.ts.snap +172 -0
- package/tests/admin/__snapshots__/get-moderation-actions.test.ts.snap +178 -0
- package/tests/admin/__snapshots__/get-moderation-report.test.ts.snap +177 -0
- package/tests/admin/__snapshots__/get-moderation-reports.test.ts.snap +307 -0
- package/tests/admin/__snapshots__/get-record.test.ts.snap +275 -0
- package/tests/admin/__snapshots__/get-repo.test.ts.snap +103 -0
- package/tests/admin/get-moderation-action.test.ts +100 -0
- package/tests/admin/get-moderation-actions.test.ts +164 -0
- package/tests/admin/get-moderation-report.test.ts +100 -0
- package/tests/admin/get-moderation-reports.test.ts +332 -0
- package/tests/admin/get-record.test.ts +115 -0
- package/tests/admin/get-repo.test.ts +101 -0
- package/tests/{moderation.test.ts → admin/moderation.test.ts} +107 -9
- package/tests/admin/repo-search.test.ts +124 -0
- package/tests/algos/hot-classic.test.ts +3 -5
- package/tests/algos/whats-hot.test.ts +3 -5
- package/tests/algos/with-friends.test.ts +2 -4
- package/tests/auth.test.ts +64 -0
- package/tests/auto-moderator/fuzzy-matcher.test.ts +2 -3
- package/tests/auto-moderator/labeler.test.ts +5 -7
- package/tests/auto-moderator/takedowns.test.ts +11 -12
- package/tests/blob-resolver.test.ts +1 -3
- package/tests/did-cache.test.ts +2 -5
- package/tests/feed-generation.test.ts +8 -6
- package/tests/handle-invalidation.test.ts +2 -3
- package/tests/image/server.test.ts +1 -4
- package/tests/image/sharp.test.ts +1 -1
- package/tests/indexing.test.ts +4 -4
- package/tests/notification-server.test.ts +2 -3
- package/tests/pipeline/backpressure.test.ts +2 -3
- package/tests/pipeline/reingest.test.ts +7 -4
- package/tests/pipeline/repartition.test.ts +2 -3
- package/tests/reprocessing.test.ts +2 -6
- package/tests/seeds/basic.ts +4 -4
- package/tests/seeds/follows.ts +1 -1
- package/tests/seeds/likes.ts +1 -1
- package/tests/seeds/reposts.ts +1 -1
- package/tests/seeds/users-bulk.ts +1 -1
- package/tests/seeds/users.ts +1 -1
- package/tests/server.test.ts +1 -3
- package/tests/subscription/repo.test.ts +2 -4
- package/tests/views/__snapshots__/author-feed.test.ts.snap +24 -24
- package/tests/views/__snapshots__/block-lists.test.ts.snap +42 -7
- package/tests/views/__snapshots__/blocks.test.ts.snap +2 -2
- package/tests/views/__snapshots__/list-feed.test.ts.snap +6 -6
- package/tests/views/__snapshots__/mute-lists.test.ts.snap +15 -4
- package/tests/views/__snapshots__/mutes.test.ts.snap +2 -2
- package/tests/views/__snapshots__/notifications.test.ts.snap +2 -2
- package/tests/views/__snapshots__/posts.test.ts.snap +8 -8
- package/tests/views/__snapshots__/thread.test.ts.snap +10 -10
- package/tests/views/__snapshots__/timeline.test.ts.snap +58 -58
- package/tests/views/actor-likes.test.ts +2 -3
- package/tests/views/actor-search.test.ts +5 -5
- package/tests/views/admin/repo-search.test.ts +2 -4
- package/tests/views/author-feed.test.ts +2 -4
- package/tests/views/block-lists.test.ts +34 -7
- package/tests/views/blocks.test.ts +6 -3
- package/tests/views/follows.test.ts +2 -4
- package/tests/views/likes.test.ts +2 -5
- package/tests/views/list-feed.test.ts +2 -4
- package/tests/views/mute-lists.test.ts +23 -5
- package/tests/views/mutes.test.ts +2 -5
- package/tests/views/notifications.test.ts +2 -4
- package/tests/views/posts.test.ts +2 -5
- package/tests/views/profile.test.ts +4 -5
- package/tests/views/reposts.test.ts +2 -4
- package/tests/views/suggested-follows.test.ts +2 -3
- package/tests/views/suggestions.test.ts +2 -4
- package/tests/views/thread.test.ts +2 -4
- package/tests/views/threadgating.test.ts +2 -3
- package/tests/views/timeline.test.ts +2 -4
- package/dist/env.d.ts +0 -1
- package/example.dev.env +0 -5
- package/src/env.ts +0 -9
- package/tests/seeds/client.ts +0 -466
- /package/tests/{__snapshots__ → admin/__snapshots__}/moderation.test.ts.snap +0 -0
- /package/tests/{image/fixtures → sample-img}/at.png +0 -0
- /package/tests/{image/fixtures → sample-img}/hd-key.jpg +0 -0
- /package/tests/{image/fixtures → sample-img}/key-alt.jpg +0 -0
- /package/tests/{image/fixtures → sample-img}/key-landscape-large.jpg +0 -0
- /package/tests/{image/fixtures → sample-img}/key-landscape-small.jpg +0 -0
- /package/tests/{image/fixtures → sample-img}/key-portrait-large.jpg +0 -0
- /package/tests/{image/fixtures → sample-img}/key-portrait-small.jpg +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atproto/bsky
|
|
2
2
|
|
|
3
|
+
## 0.0.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`9c98a5ba`](https://github.com/bluesky-social/atproto/commit/9c98a5baaf503b02238a6afe4f6e2b79c5181693), [`bb039d8e`](https://github.com/bluesky-social/atproto/commit/bb039d8e4ce5b7f70c4f3e86d1327e210ef24dc3), [`35d108ce`](https://github.com/bluesky-social/atproto/commit/35d108ce94866ce1b3d147cd0620a0ba1c4ebcd7)]:
|
|
8
|
+
- @atproto/api@0.6.21
|
|
9
|
+
- @atproto/identity@0.3.0
|
|
10
|
+
- @atproto/repo@0.3.3
|
|
11
|
+
- @atproto/common@0.3.2
|
|
12
|
+
- @atproto/lexicon@0.2.3
|
|
13
|
+
- @atproto/syntax@0.1.3
|
|
14
|
+
- @atproto/xrpc-server@0.3.3
|
|
15
|
+
|
|
3
16
|
## 0.0.11
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import AppContext from '../../../../context';
|
|
2
|
+
import { RepoView, RepoViewDetail, AccountView } from '../../../../lexicon/types/com/atproto/admin/defs';
|
|
3
|
+
export declare const getPdsAccountInfo: (ctx: AppContext, did: string) => Promise<AccountView | null>;
|
|
4
|
+
export declare const addAccountInfoToRepoViewDetail: (repoView: RepoViewDetail, accountInfo: AccountView | null, includeEmail?: boolean) => RepoViewDetail;
|
|
5
|
+
export declare const addAccountInfoToRepoView: (repoView: RepoView, accountInfo: AccountView | null, includeEmail?: boolean) => RepoView;
|
package/dist/context.d.ts
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
/// <reference types="express" />
|
|
3
3
|
import * as plc from '@did-plc/lib';
|
|
4
4
|
import { IdResolver } from '@atproto/identity';
|
|
5
|
+
import { AtpAgent } from '@atproto/api';
|
|
6
|
+
import { Keypair } from '@atproto/crypto';
|
|
5
7
|
import { DatabaseCoordinator } from './db';
|
|
6
8
|
import { ServerConfig } from './config';
|
|
7
9
|
import { ImageUriBuilder } from './image/uri';
|
|
@@ -11,7 +13,6 @@ import { BackgroundQueue } from './background';
|
|
|
11
13
|
import { MountedAlgos } from './feed-gen/types';
|
|
12
14
|
import { LabelCache } from './label-cache';
|
|
13
15
|
import { NotificationServer } from './notifications';
|
|
14
|
-
import { AtpAgent } from '@atproto/api';
|
|
15
16
|
export declare class AppContext {
|
|
16
17
|
private opts;
|
|
17
18
|
constructor(opts: {
|
|
@@ -19,6 +20,7 @@ export declare class AppContext {
|
|
|
19
20
|
imgUriBuilder: ImageUriBuilder;
|
|
20
21
|
cfg: ServerConfig;
|
|
21
22
|
services: Services;
|
|
23
|
+
signingKey: Keypair;
|
|
22
24
|
idResolver: IdResolver;
|
|
23
25
|
didCache: DidSqlCache;
|
|
24
26
|
labelCache: LabelCache;
|
|
@@ -31,6 +33,7 @@ export declare class AppContext {
|
|
|
31
33
|
get imgUriBuilder(): ImageUriBuilder;
|
|
32
34
|
get cfg(): ServerConfig;
|
|
33
35
|
get services(): Services;
|
|
36
|
+
get signingKey(): Keypair;
|
|
34
37
|
get plcClient(): plc.Client;
|
|
35
38
|
get idResolver(): IdResolver;
|
|
36
39
|
get didCache(): DidSqlCache;
|
|
@@ -110,6 +113,8 @@ export declare class AppContext {
|
|
|
110
113
|
triage: boolean;
|
|
111
114
|
};
|
|
112
115
|
}>;
|
|
116
|
+
serviceAuthJwt(aud: string): Promise<string>;
|
|
117
|
+
pdsAdminAgent(did: string): Promise<AtpAgent>;
|
|
113
118
|
get backgroundQueue(): BackgroundQueue;
|
|
114
119
|
get algos(): MountedAlgos;
|
|
115
120
|
}
|
package/dist/db/index.js
CHANGED
|
@@ -29909,6 +29909,25 @@ var DAY = HOUR * 24;
|
|
|
29909
29909
|
// ../common-web/src/strings.ts
|
|
29910
29910
|
var import_graphemer = __toESM(require_lib());
|
|
29911
29911
|
|
|
29912
|
+
// ../common-web/src/did-doc.ts
|
|
29913
|
+
var verificationMethod = z.object({
|
|
29914
|
+
id: z.string(),
|
|
29915
|
+
type: z.string(),
|
|
29916
|
+
controller: z.string(),
|
|
29917
|
+
publicKeyMultibase: z.string().optional()
|
|
29918
|
+
});
|
|
29919
|
+
var service = z.object({
|
|
29920
|
+
id: z.string(),
|
|
29921
|
+
type: z.string(),
|
|
29922
|
+
serviceEndpoint: z.union([z.string(), z.record(z.unknown())])
|
|
29923
|
+
});
|
|
29924
|
+
var didDocument = z.object({
|
|
29925
|
+
id: z.string(),
|
|
29926
|
+
alsoKnownAs: z.array(z.string()).optional(),
|
|
29927
|
+
verificationMethod: z.array(verificationMethod).optional(),
|
|
29928
|
+
service: z.array(service).optional()
|
|
29929
|
+
});
|
|
29930
|
+
|
|
29912
29931
|
// ../common/src/dates.ts
|
|
29913
29932
|
var import_iso_datestring_validator = __toESM(require_dist());
|
|
29914
29933
|
|
|
@@ -33482,7 +33501,8 @@ __export(migrations_exports, {
|
|
|
33482
33501
|
_20230830T205507322Z: () => T205507322Z_suggested_feeds_exports,
|
|
33483
33502
|
_20230904T211011773Z: () => T211011773Z_block_lists_exports,
|
|
33484
33503
|
_20230906T222220386Z: () => T222220386Z_thread_gating_exports,
|
|
33485
|
-
_20230920T213858047Z: () => T213858047Z_add_tags_to_post_exports
|
|
33504
|
+
_20230920T213858047Z: () => T213858047Z_add_tags_to_post_exports,
|
|
33505
|
+
_20230929T192920807Z: () => T192920807Z_record_cursor_indexes_exports
|
|
33486
33506
|
});
|
|
33487
33507
|
|
|
33488
33508
|
// src/db/migrations/20230309T045948368Z-init.ts
|
|
@@ -33960,6 +33980,27 @@ async function down27(db) {
|
|
|
33960
33980
|
await db.schema.alterTable("post").dropColumn("tags").execute();
|
|
33961
33981
|
}
|
|
33962
33982
|
|
|
33983
|
+
// src/db/migrations/20230929T192920807Z-record-cursor-indexes.ts
|
|
33984
|
+
var T192920807Z_record_cursor_indexes_exports = {};
|
|
33985
|
+
__export(T192920807Z_record_cursor_indexes_exports, {
|
|
33986
|
+
down: () => down28,
|
|
33987
|
+
up: () => up28
|
|
33988
|
+
});
|
|
33989
|
+
async function up28(db) {
|
|
33990
|
+
await db.schema.createIndex("like_creator_cursor_idx").on("like").columns(["creator", "sortAt", "cid"]).execute();
|
|
33991
|
+
await db.schema.createIndex("follow_creator_cursor_idx").on("follow").columns(["creator", "sortAt", "cid"]).execute();
|
|
33992
|
+
await db.schema.createIndex("follow_subject_cursor_idx").on("follow").columns(["subjectDid", "sortAt", "cid"]).execute();
|
|
33993
|
+
await db.schema.dropIndex("like_creator_idx").execute();
|
|
33994
|
+
await db.schema.dropIndex("follow_subjectdid_idx").execute();
|
|
33995
|
+
}
|
|
33996
|
+
async function down28(db) {
|
|
33997
|
+
await db.schema.createIndex("like_creator_idx").on("like").column("creator").execute();
|
|
33998
|
+
await db.schema.createIndex("follow_subjectdid_idx").on("follow").column("subjectDid").execute();
|
|
33999
|
+
await db.schema.dropIndex("like_creator_cursor_idx").execute();
|
|
34000
|
+
await db.schema.dropIndex("follow_creator_cursor_idx").execute();
|
|
34001
|
+
await db.schema.dropIndex("follow_subject_cursor_idx").execute();
|
|
34002
|
+
}
|
|
34003
|
+
|
|
33963
34004
|
// src/db/migrations/provider.ts
|
|
33964
34005
|
var CtxMigrationProvider = class {
|
|
33965
34006
|
constructor(migrations, ctx) {
|
|
@@ -33985,7 +34026,15 @@ var subLogger = subsystemLogger("bsky:sub");
|
|
|
33985
34026
|
var labelerLogger = subsystemLogger("bsky:labeler");
|
|
33986
34027
|
var httpLogger = subsystemLogger("bsky");
|
|
33987
34028
|
var loggerMiddleware = (0, import_pino_http.default)({
|
|
33988
|
-
logger: httpLogger
|
|
34029
|
+
logger: httpLogger,
|
|
34030
|
+
serializers: {
|
|
34031
|
+
err: (err) => {
|
|
34032
|
+
return {
|
|
34033
|
+
code: err?.code,
|
|
34034
|
+
message: err?.message
|
|
34035
|
+
};
|
|
34036
|
+
}
|
|
34037
|
+
}
|
|
33989
34038
|
});
|
|
33990
34039
|
|
|
33991
34040
|
// src/db/db.ts
|