@atproto/bsky 0.0.16 → 0.0.17
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 +7 -0
- package/dist/cache/read-through.d.ts +30 -0
- package/dist/config.d.ts +18 -0
- package/dist/context.d.ts +6 -6
- package/dist/daemon/config.d.ts +15 -0
- package/dist/daemon/context.d.ts +15 -0
- package/dist/daemon/index.d.ts +23 -0
- package/dist/daemon/logger.d.ts +3 -0
- package/dist/daemon/notifications.d.ts +18 -0
- package/dist/daemon/services.d.ts +11 -0
- package/dist/db/database-schema.d.ts +1 -2
- package/dist/db/index.js +16 -1
- package/dist/db/index.js.map +3 -3
- package/dist/db/migrations/20231205T000257238Z-remove-did-cache.d.ts +3 -0
- package/dist/db/migrations/index.d.ts +1 -0
- package/dist/did-cache.d.ts +10 -7
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1917 -934
- package/dist/index.js.map +3 -3
- package/dist/indexer/context.d.ts +2 -0
- package/dist/indexer/index.d.ts +1 -0
- package/dist/lexicon/index.d.ts +12 -0
- package/dist/lexicon/lexicons.d.ts +134 -0
- package/dist/lexicon/types/com/atproto/admin/deleteAccount.d.ts +25 -0
- package/dist/lexicon/types/com/atproto/temp/importRepo.d.ts +32 -0
- package/dist/lexicon/types/com/atproto/temp/pushBlob.d.ts +25 -0
- package/dist/lexicon/types/com/atproto/temp/transferAccount.d.ts +42 -0
- package/dist/logger.d.ts +1 -0
- package/dist/redis.d.ts +10 -1
- package/dist/services/actor/index.d.ts +18 -4
- package/dist/services/actor/views.d.ts +4 -3
- package/dist/services/feed/index.d.ts +6 -4
- package/dist/services/feed/views.d.ts +5 -4
- package/dist/services/index.d.ts +3 -7
- package/dist/services/label/index.d.ts +10 -4
- package/dist/services/moderation/index.d.ts +0 -1
- package/dist/services/types.d.ts +3 -0
- package/dist/services/util/notification.d.ts +5 -0
- package/dist/services/util/post.d.ts +6 -6
- package/dist/util/retry.d.ts +1 -6
- package/package.json +5 -5
- package/src/cache/read-through.ts +151 -0
- package/src/config.ts +90 -1
- package/src/context.ts +7 -7
- package/src/daemon/config.ts +60 -0
- package/src/daemon/context.ts +27 -0
- package/src/daemon/index.ts +78 -0
- package/src/daemon/logger.ts +6 -0
- package/src/daemon/notifications.ts +54 -0
- package/src/daemon/services.ts +22 -0
- package/src/db/database-schema.ts +0 -2
- package/src/db/migrations/20231205T000257238Z-remove-did-cache.ts +14 -0
- package/src/db/migrations/index.ts +1 -0
- package/src/did-cache.ts +33 -56
- package/src/feed-gen/index.ts +0 -4
- package/src/index.ts +55 -16
- package/src/indexer/context.ts +5 -0
- package/src/indexer/index.ts +10 -7
- package/src/lexicon/index.ts +50 -0
- package/src/lexicon/lexicons.ts +156 -0
- package/src/lexicon/types/com/atproto/admin/deleteAccount.ts +38 -0
- package/src/lexicon/types/com/atproto/temp/importRepo.ts +45 -0
- package/src/lexicon/types/com/atproto/temp/pushBlob.ts +39 -0
- package/src/lexicon/types/com/atproto/temp/transferAccount.ts +62 -0
- package/src/logger.ts +2 -0
- package/src/redis.ts +43 -3
- package/src/services/actor/index.ts +55 -7
- package/src/services/actor/views.ts +13 -7
- package/src/services/feed/index.ts +27 -13
- package/src/services/feed/views.ts +20 -10
- package/src/services/index.ts +14 -14
- package/src/services/indexing/index.ts +7 -10
- package/src/services/indexing/plugins/post.ts +13 -0
- package/src/services/label/index.ts +66 -22
- package/src/services/moderation/index.ts +1 -1
- package/src/services/moderation/status.ts +1 -4
- package/src/services/types.ts +4 -0
- package/src/services/util/notification.ts +70 -0
- package/src/util/retry.ts +1 -44
- package/tests/admin/get-repo.test.ts +5 -3
- package/tests/admin/moderation.test.ts +2 -2
- package/tests/admin/repo-search.test.ts +1 -0
- package/tests/algos/hot-classic.test.ts +1 -2
- package/tests/auth.test.ts +1 -1
- package/tests/auto-moderator/labeler.test.ts +19 -20
- package/tests/auto-moderator/takedowns.test.ts +16 -10
- package/tests/blob-resolver.test.ts +4 -2
- package/tests/daemon.test.ts +191 -0
- package/tests/did-cache.test.ts +20 -5
- package/tests/handle-invalidation.test.ts +1 -5
- package/tests/indexing.test.ts +20 -13
- package/tests/redis-cache.test.ts +231 -0
- package/tests/seeds/basic.ts +3 -0
- package/tests/subscription/repo.test.ts +4 -7
- package/tests/views/profile.test.ts +0 -1
- package/tests/views/thread.test.ts +73 -78
- package/tests/views/threadgating.test.ts +38 -0
- package/dist/db/tables/did-cache.d.ts +0 -10
- package/dist/feed-gen/best-of-follows.d.ts +0 -29
- package/dist/feed-gen/whats-hot.d.ts +0 -29
- package/dist/feed-gen/with-friends.d.ts +0 -3
- package/dist/label-cache.d.ts +0 -19
- package/src/db/tables/did-cache.ts +0 -13
- package/src/feed-gen/best-of-follows.ts +0 -77
- package/src/feed-gen/whats-hot.ts +0 -101
- package/src/feed-gen/with-friends.ts +0 -43
- package/src/label-cache.ts +0 -90
- package/tests/algos/whats-hot.test.ts +0 -118
- package/tests/algos/with-friends.test.ts +0 -145
|
@@ -27,3 +27,4 @@ export * as _20230906T222220386Z from './20230906T222220386Z-thread-gating';
|
|
|
27
27
|
export * as _20230920T213858047Z from './20230920T213858047Z-add-tags-to-post';
|
|
28
28
|
export * as _20230929T192920807Z from './20230929T192920807Z-record-cursor-indexes';
|
|
29
29
|
export * as _20231003T202833377Z from './20231003T202833377Z-create-moderation-subject-status';
|
|
30
|
+
export * as _20231205T000257238Z from './20231205T000257238Z-remove-did-cache';
|
package/dist/did-cache.d.ts
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import PQueue from 'p-queue';
|
|
2
2
|
import { CacheResult, DidCache, DidDocument } from '@atproto/identity';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
db: PrimaryDatabase;
|
|
3
|
+
import { Redis } from './redis';
|
|
4
|
+
declare type CacheOptions = {
|
|
6
5
|
staleTTL: number;
|
|
7
6
|
maxTTL: number;
|
|
7
|
+
};
|
|
8
|
+
export declare class DidRedisCache implements DidCache {
|
|
9
|
+
redis: Redis;
|
|
10
|
+
opts: CacheOptions;
|
|
8
11
|
pQueue: PQueue | null;
|
|
9
|
-
constructor(
|
|
10
|
-
cacheDid(did: string, doc: DidDocument
|
|
11
|
-
refreshCache(did: string, getDoc: () => Promise<DidDocument | null
|
|
12
|
+
constructor(redis: Redis, opts: CacheOptions);
|
|
13
|
+
cacheDid(did: string, doc: DidDocument): Promise<void>;
|
|
14
|
+
refreshCache(did: string, getDoc: () => Promise<DidDocument | null>): Promise<void>;
|
|
12
15
|
checkCache(did: string): Promise<CacheResult | null>;
|
|
13
16
|
clearEntry(did: string): Promise<void>;
|
|
14
17
|
clear(): Promise<void>;
|
|
15
18
|
processAll(): Promise<void>;
|
|
16
19
|
destroy(): Promise<void>;
|
|
17
20
|
}
|
|
18
|
-
export default
|
|
21
|
+
export default DidRedisCache;
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import AppContext from './context';
|
|
|
7
7
|
import { ImageInvalidator } from './image/invalidator';
|
|
8
8
|
import { MountedAlgos } from './feed-gen/types';
|
|
9
9
|
import { Keypair } from '@atproto/crypto';
|
|
10
|
+
import { Redis } from './redis';
|
|
10
11
|
export type { ServerConfigValues } from './config';
|
|
11
12
|
export type { MountedAlgos } from './feed-gen/types';
|
|
12
13
|
export { ServerConfig } from './config';
|
|
@@ -16,6 +17,7 @@ export { Redis } from './redis';
|
|
|
16
17
|
export { ViewMaintainer } from './db/views';
|
|
17
18
|
export { AppContext } from './context';
|
|
18
19
|
export { makeAlgos } from './feed-gen';
|
|
20
|
+
export * from './daemon';
|
|
19
21
|
export * from './indexer';
|
|
20
22
|
export * from './ingester';
|
|
21
23
|
export { MigrateModerationData } from './migrate-moderation-data';
|
|
@@ -31,6 +33,7 @@ export declare class BskyAppView {
|
|
|
31
33
|
});
|
|
32
34
|
static create(opts: {
|
|
33
35
|
db: DatabaseCoordinator;
|
|
36
|
+
redis: Redis;
|
|
34
37
|
config: ServerConfig;
|
|
35
38
|
signingKey: Keypair;
|
|
36
39
|
imgInvalidator?: ImageInvalidator;
|
|
@@ -39,6 +42,7 @@ export declare class BskyAppView {
|
|
|
39
42
|
start(): Promise<http.Server>;
|
|
40
43
|
destroy(opts?: {
|
|
41
44
|
skipDb: boolean;
|
|
45
|
+
skipRedis: boolean;
|
|
42
46
|
}): Promise<void>;
|
|
43
47
|
}
|
|
44
48
|
export default BskyAppView;
|