@atproto/bsky 0.0.11 → 0.0.13
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 +29 -0
- package/LICENSE.txt +7 -0
- package/README.md +6 -1
- 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 +1630 -755
- package/dist/index.js.map +3 -3
- package/dist/lexicon/index.d.ts +8 -0
- package/dist/lexicon/lexicons.d.ts +243 -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 +4 -2
- 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 +36 -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 +14 -15
- 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 +259 -5
- 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 +4 -2
- 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 +51 -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/LICENSE +0 -21
- 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,34 @@
|
|
|
1
1
|
# @atproto/bsky
|
|
2
2
|
|
|
3
|
+
## 0.0.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1788](https://github.com/bluesky-social/atproto/pull/1788) [`84e2d4d2`](https://github.com/bluesky-social/atproto/commit/84e2d4d2b6694f344d80c18672c78b650189d423) Thanks [@bnewbold](https://github.com/bnewbold)! - update license to "MIT or Apache2"
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`ce49743d`](https://github.com/bluesky-social/atproto/commit/ce49743d7f8800d33116b88001d7b512553c2c89), [`84e2d4d2`](https://github.com/bluesky-social/atproto/commit/84e2d4d2b6694f344d80c18672c78b650189d423)]:
|
|
10
|
+
- @atproto/lexicon@0.3.0
|
|
11
|
+
- @atproto/xrpc-server@0.4.0
|
|
12
|
+
- @atproto/identity@0.3.1
|
|
13
|
+
- @atproto/common@0.3.3
|
|
14
|
+
- @atproto/crypto@0.2.3
|
|
15
|
+
- @atproto/syntax@0.1.4
|
|
16
|
+
- @atproto/repo@0.3.4
|
|
17
|
+
- @atproto/api@0.6.22
|
|
18
|
+
|
|
19
|
+
## 0.0.12
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- 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)]:
|
|
24
|
+
- @atproto/api@0.6.21
|
|
25
|
+
- @atproto/identity@0.3.0
|
|
26
|
+
- @atproto/repo@0.3.3
|
|
27
|
+
- @atproto/common@0.3.2
|
|
28
|
+
- @atproto/lexicon@0.2.3
|
|
29
|
+
- @atproto/syntax@0.1.3
|
|
30
|
+
- @atproto/xrpc-server@0.3.3
|
|
31
|
+
|
|
3
32
|
## 0.0.11
|
|
4
33
|
|
|
5
34
|
### Patch Changes
|
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Dual MIT/Apache-2.0 License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022-2023 Bluesky PBC, and Contributors
|
|
4
|
+
|
|
5
|
+
Except as otherwise noted in individual files, this software is licensed under the MIT license (<http://opensource.org/licenses/MIT>), or the Apache License, Version 2.0 (<http://www.apache.org/licenses/LICENSE-2.0>).
|
|
6
|
+
|
|
7
|
+
Downstream projects and end users may chose either license individually, or both together, at their discretion. The motivation for this dual-licensing is the additional software patent assurance provided by Apache 2.0.
|
package/README.md
CHANGED
|
@@ -7,4 +7,9 @@ TypeScript implementation of the `app.bsky` Lexicons backing the https://bsky.ap
|
|
|
7
7
|
|
|
8
8
|
## License
|
|
9
9
|
|
|
10
|
-
MIT
|
|
10
|
+
This project is dual-licensed under MIT and Apache 2.0 terms:
|
|
11
|
+
|
|
12
|
+
- MIT license ([LICENSE-MIT.txt](https://github.com/bluesky-social/atproto/blob/main/LICENSE-MIT.txt) or http://opensource.org/licenses/MIT)
|
|
13
|
+
- Apache License, Version 2.0, ([LICENSE-APACHE.txt](https://github.com/bluesky-social/atproto/blob/main/LICENSE-APACHE.txt) or http://www.apache.org/licenses/LICENSE-2.0)
|
|
14
|
+
|
|
15
|
+
Downstream projects and end users may chose either license individually, or both together, at their discretion. The motivation for this dual-licensing is the additional software patent assurance provided by Apache 2.0.
|
|
@@ -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
|