@atproto/sync 0.2.4 → 0.3.0
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 +22 -0
- package/dist/events.js +1 -2
- package/dist/firehose/index.d.ts +2 -2
- package/dist/firehose/index.d.ts.map +1 -1
- package/dist/firehose/index.js +48 -104
- package/dist/firehose/index.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -19
- package/dist/index.js.map +1 -1
- package/dist/lexicons/com/atproto/sync/subscribeRepos.defs.js +54 -57
- package/dist/lexicons/com/atproto/sync/subscribeRepos.defs.js.map +1 -1
- package/dist/lexicons/com/atproto/sync/subscribeRepos.js +2 -41
- package/dist/lexicons/com/atproto/sync/subscribeRepos.js.map +1 -1
- package/dist/lexicons/com/atproto/sync.js +1 -37
- package/dist/lexicons/com/atproto/sync.js.map +1 -1
- package/dist/lexicons/com/atproto.js +1 -37
- package/dist/lexicons/com/atproto.js.map +1 -1
- package/dist/lexicons/com.js +1 -37
- package/dist/lexicons/com.js.map +1 -1
- package/dist/lexicons/index.js +1 -37
- package/dist/lexicons/index.js.map +1 -1
- package/dist/runner/consecutive-list.js +6 -31
- package/dist/runner/consecutive-list.js.map +1 -1
- package/dist/runner/index.d.ts +3 -3
- package/dist/runner/index.d.ts.map +1 -1
- package/dist/runner/index.js +3 -19
- package/dist/runner/index.js.map +1 -1
- package/dist/runner/memory-runner.d.ts +6 -4
- package/dist/runner/memory-runner.d.ts.map +1 -1
- package/dist/runner/memory-runner.js +8 -42
- package/dist/runner/memory-runner.js.map +1 -1
- package/dist/runner/types.js +1 -2
- package/dist/util.js +6 -10
- package/dist/util.js.map +1 -1
- package/jest.config.cjs +22 -0
- package/package.json +19 -14
- package/src/firehose/index.ts +3 -3
- package/src/index.ts +3 -3
- package/src/runner/index.ts +3 -3
- package/src/runner/memory-runner.ts +6 -4
- package/tests/firehose.test.ts +7 -1
- package/tests/runner.test.ts +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/tsconfig.tests.json +1 -1
- package/jest.config.js +0 -8
|
@@ -1,46 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.MemoryRunner = void 0;
|
|
7
|
-
const p_queue_1 = __importDefault(require("p-queue"));
|
|
8
|
-
const consecutive_list_1 = require("./consecutive-list");
|
|
1
|
+
import PQueue from 'p-queue';
|
|
2
|
+
import { ConsecutiveList } from './consecutive-list.js';
|
|
9
3
|
// A queue with arbitrarily many partitions, each processing work sequentially.
|
|
10
4
|
// Partitions are created lazily and taken out of memory when they go idle.
|
|
11
|
-
class MemoryRunner {
|
|
5
|
+
export class MemoryRunner {
|
|
12
6
|
constructor(opts = {}) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
value: opts
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(this, "consecutive", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
configurable: true,
|
|
22
|
-
writable: true,
|
|
23
|
-
value: new consecutive_list_1.ConsecutiveList()
|
|
24
|
-
});
|
|
25
|
-
Object.defineProperty(this, "mainQueue", {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
configurable: true,
|
|
28
|
-
writable: true,
|
|
29
|
-
value: void 0
|
|
30
|
-
});
|
|
31
|
-
Object.defineProperty(this, "partitions", {
|
|
32
|
-
enumerable: true,
|
|
33
|
-
configurable: true,
|
|
34
|
-
writable: true,
|
|
35
|
-
value: new Map()
|
|
36
|
-
});
|
|
37
|
-
Object.defineProperty(this, "cursor", {
|
|
38
|
-
enumerable: true,
|
|
39
|
-
configurable: true,
|
|
40
|
-
writable: true,
|
|
41
|
-
value: void 0
|
|
42
|
-
});
|
|
43
|
-
this.mainQueue = new p_queue_1.default({ concurrency: opts.concurrency ?? Infinity });
|
|
7
|
+
this.opts = opts;
|
|
8
|
+
this.consecutive = new ConsecutiveList();
|
|
9
|
+
this.partitions = new Map();
|
|
10
|
+
this.mainQueue = new PQueue({ concurrency: opts.concurrency ?? Infinity });
|
|
44
11
|
this.cursor = opts.startCursor;
|
|
45
12
|
}
|
|
46
13
|
getCursor() {
|
|
@@ -56,7 +23,7 @@ class MemoryRunner {
|
|
|
56
23
|
getPartition(partitionId) {
|
|
57
24
|
let partition = this.partitions.get(partitionId);
|
|
58
25
|
if (!partition) {
|
|
59
|
-
partition = new
|
|
26
|
+
partition = new PQueue({ concurrency: 1 });
|
|
60
27
|
partition.once('idle', () => this.partitions.delete(partitionId));
|
|
61
28
|
this.partitions.set(partitionId, partition);
|
|
62
29
|
}
|
|
@@ -87,5 +54,4 @@ class MemoryRunner {
|
|
|
87
54
|
await this.mainQueue.onIdle();
|
|
88
55
|
}
|
|
89
56
|
}
|
|
90
|
-
exports.MemoryRunner = MemoryRunner;
|
|
91
57
|
//# sourceMappingURL=memory-runner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-runner.js","sourceRoot":"","sources":["../../src/runner/memory-runner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"memory-runner.js","sourceRoot":"","sources":["../../src/runner/memory-runner.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAWvD,+EAA+E;AAC/E,2EAA2E;AAC3E,MAAM,OAAO,YAAY;IAMvB,YAAmB,OAA4B,EAAE;QAA9B,SAAI,GAAJ,IAAI,CAA0B;QALjD,gBAAW,GAAG,IAAI,eAAe,EAAU,CAAA;QAE3C,eAAU,GAAuB,IAAI,GAAG,EAAE,CAAA;QAIxC,IAAI,CAAC,SAAS,GAAG,IAAI,MAAM,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,QAAQ,EAAE,CAAC,CAAA;QAC1E,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW,CAAA;IAChC,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,WAAmB,EAAE,IAAyB;QAC1D,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ;YAAE,OAAM;QACnC,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE;YAC7B,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACjD,CAAC,CAAC,CAAA;IACJ,CAAC;IAEO,YAAY,CAAC,WAAmB;QACtC,IAAI,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;QAChD,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,SAAS,GAAG,IAAI,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAAA;YAC1C,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAA;YACjE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,WAAW,EAAE,SAAS,CAAC,CAAA;QAC7C,CAAC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,GAAW,EAAE,GAAW,EAAE,OAA4B;QACrE,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ;YAAE,OAAM;QACnC,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QACvC,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,IAAI,EAAE;YACjC,MAAM,OAAO,EAAE,CAAA;YACf,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;YACrC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;gBACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;gBACpB,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;oBACxB,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;gBACxC,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,UAAU;QACd,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAA;IAC/B,CAAC;IAED,KAAK,CAAC,OAAO;QACX,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAA;QACtB,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAA;QACtB,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAA;QACzC,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAA;IAC/B,CAAC;CACF","sourcesContent":["import PQueue from 'p-queue'\nimport { ConsecutiveList } from './consecutive-list.js'\nimport { EventRunner } from './types.js'\n\nexport type MemoryRunnerOptions = {\n setCursor?: (cursor: number) => Promise<void>\n concurrency?: number\n startCursor?: number\n}\n\ntype Queue = InstanceType<typeof PQueue>\n\n// A queue with arbitrarily many partitions, each processing work sequentially.\n// Partitions are created lazily and taken out of memory when they go idle.\nexport class MemoryRunner implements EventRunner {\n consecutive = new ConsecutiveList<number>()\n mainQueue: Queue\n partitions: Map<string, Queue> = new Map()\n cursor: number | undefined\n\n constructor(public opts: MemoryRunnerOptions = {}) {\n this.mainQueue = new PQueue({ concurrency: opts.concurrency ?? Infinity })\n this.cursor = opts.startCursor\n }\n\n getCursor() {\n return this.cursor\n }\n\n async addTask(partitionId: string, task: () => Promise<void>) {\n if (this.mainQueue.isPaused) return\n return this.mainQueue.add(() => {\n return this.getPartition(partitionId).add(task)\n })\n }\n\n private getPartition(partitionId: string) {\n let partition = this.partitions.get(partitionId)\n if (!partition) {\n partition = new PQueue({ concurrency: 1 })\n partition.once('idle', () => this.partitions.delete(partitionId))\n this.partitions.set(partitionId, partition)\n }\n return partition\n }\n\n async trackEvent(did: string, seq: number, handler: () => Promise<void>) {\n if (this.mainQueue.isPaused) return\n const item = this.consecutive.push(seq)\n await this.addTask(did, async () => {\n await handler()\n const latest = item.complete().at(-1)\n if (latest !== undefined) {\n this.cursor = latest\n if (this.opts.setCursor) {\n await this.opts.setCursor(this.cursor)\n }\n }\n })\n }\n\n async processAll() {\n await this.mainQueue.onIdle()\n }\n\n async destroy() {\n this.mainQueue.pause()\n this.mainQueue.clear()\n this.partitions.forEach((p) => p.clear())\n await this.mainQueue.onIdle()\n }\n}\n"]}
|
package/dist/runner/types.js
CHANGED
package/dist/util.js
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const index_js_1 = require("./lexicons/index.js");
|
|
5
|
-
const didAndSeqForEvt = (evt) => {
|
|
6
|
-
if (index_js_1.com.atproto.sync.subscribeRepos.commit.$isTypeOf(evt)) {
|
|
1
|
+
import { com } from './lexicons/index.js';
|
|
2
|
+
export const didAndSeqForEvt = (evt) => {
|
|
3
|
+
if (com.atproto.sync.subscribeRepos.commit.$isTypeOf(evt)) {
|
|
7
4
|
return { seq: evt.seq, did: evt.repo };
|
|
8
5
|
}
|
|
9
|
-
else if (
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
else if (com.atproto.sync.subscribeRepos.account.$isTypeOf(evt) ||
|
|
7
|
+
com.atproto.sync.subscribeRepos.identity.$isTypeOf(evt) ||
|
|
8
|
+
com.atproto.sync.subscribeRepos.sync.$isTypeOf(evt)) {
|
|
12
9
|
return { seq: evt.seq, did: evt.did };
|
|
13
10
|
}
|
|
14
11
|
return undefined;
|
|
15
12
|
};
|
|
16
|
-
exports.didAndSeqForEvt = didAndSeqForEvt;
|
|
17
13
|
//# sourceMappingURL=util.js.map
|
package/dist/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AAEzC,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,GAA6C,EACH,EAAE;IAC5C,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1D,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE,CAAA;IACxC,CAAC;SAAM,IACL,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC;QACtD,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC;QACvD,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EACnD,CAAC;QACD,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,CAAA;IACvC,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA","sourcesContent":["import { com } from './lexicons/index.js'\n\nexport const didAndSeqForEvt = (\n evt: com.atproto.sync.subscribeRepos.$Message,\n): { did: string; seq: number } | undefined => {\n if (com.atproto.sync.subscribeRepos.commit.$isTypeOf(evt)) {\n return { seq: evt.seq, did: evt.repo }\n } else if (\n com.atproto.sync.subscribeRepos.account.$isTypeOf(evt) ||\n com.atproto.sync.subscribeRepos.identity.$isTypeOf(evt) ||\n com.atproto.sync.subscribeRepos.sync.$isTypeOf(evt)\n ) {\n return { seq: evt.seq, did: evt.did }\n }\n return undefined\n}\n"]}
|
package/jest.config.cjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** @type {import('jest').Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
displayName: 'Sync',
|
|
4
|
+
transform: {
|
|
5
|
+
'^.+\\.(t|j)s$': [
|
|
6
|
+
'@swc/jest',
|
|
7
|
+
{
|
|
8
|
+
jsc: {
|
|
9
|
+
parser: { syntax: 'typescript', importAttributes: true },
|
|
10
|
+
experimental: { keepImportAttributes: true },
|
|
11
|
+
transform: {},
|
|
12
|
+
},
|
|
13
|
+
module: { type: 'es6' },
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
extensionsToTreatAsEsm: ['.ts'],
|
|
18
|
+
transformIgnorePatterns: [],
|
|
19
|
+
testTimeout: 60000,
|
|
20
|
+
setupFiles: ['<rootDir>/../../test.setup.ts'],
|
|
21
|
+
moduleNameMapper: { '^(\\.\\.?\\/.+)\\.js$': ['$1.ts', '$1.js'] },
|
|
22
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/sync",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "atproto sync library",
|
|
6
6
|
"keywords": [
|
|
@@ -16,29 +16,34 @@
|
|
|
16
16
|
"directory": "packages/sync"
|
|
17
17
|
},
|
|
18
18
|
"engines": {
|
|
19
|
-
"node": ">=
|
|
19
|
+
"node": ">=22"
|
|
20
20
|
},
|
|
21
|
-
"main": "dist/index.js",
|
|
22
|
-
"types": "dist/index.d.ts",
|
|
23
21
|
"dependencies": {
|
|
24
|
-
"p-queue": "^
|
|
22
|
+
"p-queue": "^8.0.0",
|
|
25
23
|
"ws": "^8.12.0",
|
|
26
|
-
"@atproto/common": "^0.
|
|
27
|
-
"@atproto/identity": "^0.
|
|
28
|
-
"@atproto/lex": "^0.0
|
|
29
|
-
"@atproto/repo": "^0.
|
|
30
|
-
"@atproto/syntax": "^0.
|
|
31
|
-
"@atproto/xrpc-server": "^0.
|
|
24
|
+
"@atproto/common": "^0.6.0",
|
|
25
|
+
"@atproto/identity": "^0.5.0",
|
|
26
|
+
"@atproto/lex": "^0.1.0",
|
|
27
|
+
"@atproto/repo": "^0.10.0",
|
|
28
|
+
"@atproto/syntax": "^0.6.0",
|
|
29
|
+
"@atproto/xrpc-server": "^0.11.0"
|
|
32
30
|
},
|
|
33
31
|
"devDependencies": {
|
|
34
32
|
"@types/ws": "^8.5.4",
|
|
35
|
-
"jest": "^
|
|
36
|
-
"typescript": "^
|
|
33
|
+
"jest": "^30.0.0",
|
|
34
|
+
"typescript": "^6.0.3"
|
|
35
|
+
},
|
|
36
|
+
"type": "module",
|
|
37
|
+
"exports": {
|
|
38
|
+
".": {
|
|
39
|
+
"types": "./dist/index.d.ts",
|
|
40
|
+
"default": "./dist/index.js"
|
|
41
|
+
}
|
|
37
42
|
},
|
|
38
43
|
"scripts": {
|
|
39
44
|
"codegen": "lex build --clear --indexFile --lexicons ../../lexicons --include com.atproto.sync.subscribeRepos",
|
|
40
45
|
"prebuild": "pnpm run codegen",
|
|
41
46
|
"build": "tsc --build tsconfig.build.json",
|
|
42
|
-
"test": "../dev-infra/with-test-redis-and-db.sh jest"
|
|
47
|
+
"test": "NODE_OPTIONS=--experimental-vm-modules ../dev-infra/with-test-redis-and-db.sh jest"
|
|
43
48
|
}
|
|
44
49
|
}
|
package/src/firehose/index.ts
CHANGED
|
@@ -25,10 +25,10 @@ import {
|
|
|
25
25
|
Event,
|
|
26
26
|
IdentityEvt,
|
|
27
27
|
SyncEvt,
|
|
28
|
-
} from '../events'
|
|
28
|
+
} from '../events.js'
|
|
29
29
|
import { com } from '../lexicons/index.js'
|
|
30
|
-
import { EventRunner } from '../runner'
|
|
31
|
-
import { didAndSeqForEvt } from '../util'
|
|
30
|
+
import { EventRunner } from '../runner/index.js'
|
|
31
|
+
import { didAndSeqForEvt } from '../util.js'
|
|
32
32
|
|
|
33
33
|
export type FirehoseOptions = ClientOptions & {
|
|
34
34
|
idResolver: IdResolver
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './runner'
|
|
2
|
-
export * from './firehose'
|
|
3
|
-
export * from './events'
|
|
1
|
+
export * from './runner/index.js'
|
|
2
|
+
export * from './firehose/index.js'
|
|
3
|
+
export * from './events.js'
|
package/src/runner/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './consecutive-list'
|
|
2
|
-
export * from './memory-runner'
|
|
3
|
-
export * from './types'
|
|
1
|
+
export * from './consecutive-list.js'
|
|
2
|
+
export * from './memory-runner.js'
|
|
3
|
+
export * from './types.js'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import PQueue from 'p-queue'
|
|
2
|
-
import { ConsecutiveList } from './consecutive-list'
|
|
3
|
-
import { EventRunner } from './types'
|
|
2
|
+
import { ConsecutiveList } from './consecutive-list.js'
|
|
3
|
+
import { EventRunner } from './types.js'
|
|
4
4
|
|
|
5
5
|
export type MemoryRunnerOptions = {
|
|
6
6
|
setCursor?: (cursor: number) => Promise<void>
|
|
@@ -8,12 +8,14 @@ export type MemoryRunnerOptions = {
|
|
|
8
8
|
startCursor?: number
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
type Queue = InstanceType<typeof PQueue>
|
|
12
|
+
|
|
11
13
|
// A queue with arbitrarily many partitions, each processing work sequentially.
|
|
12
14
|
// Partitions are created lazily and taken out of memory when they go idle.
|
|
13
15
|
export class MemoryRunner implements EventRunner {
|
|
14
16
|
consecutive = new ConsecutiveList<number>()
|
|
15
|
-
mainQueue:
|
|
16
|
-
partitions
|
|
17
|
+
mainQueue: Queue
|
|
18
|
+
partitions: Map<string, Queue> = new Map()
|
|
17
19
|
cursor: number | undefined
|
|
18
20
|
|
|
19
21
|
constructor(public opts: MemoryRunnerOptions = {}) {
|
package/tests/firehose.test.ts
CHANGED
|
@@ -6,7 +6,13 @@ import {
|
|
|
6
6
|
} from '@atproto/dev-env'
|
|
7
7
|
import { IdResolver } from '@atproto/identity'
|
|
8
8
|
import { DidString } from '@atproto/syntax'
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
Create,
|
|
11
|
+
Event,
|
|
12
|
+
Firehose,
|
|
13
|
+
FirehoseOptions,
|
|
14
|
+
MemoryRunner,
|
|
15
|
+
} from '../src/index.js'
|
|
10
16
|
|
|
11
17
|
describe('firehose', () => {
|
|
12
18
|
let network: TestNetworkNoAppView
|
package/tests/runner.test.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/events.ts","./src/index.ts","./src/util.ts","./src/firehose/index.ts","./src/lexicons/com.ts","./src/lexicons/index.ts","./src/lexicons/com/atproto.ts","./src/lexicons/com/atproto/sync.ts","./src/lexicons/com/atproto/sync/subscribeRepos.defs.ts","./src/lexicons/com/atproto/sync/subscribeRepos.ts","./src/runner/consecutive-list.ts","./src/runner/index.ts","./src/runner/memory-runner.ts","./src/runner/types.ts"],"version":"
|
|
1
|
+
{"root":["./src/events.ts","./src/index.ts","./src/util.ts","./src/firehose/index.ts","./src/lexicons/com.ts","./src/lexicons/index.ts","./src/lexicons/com/atproto.ts","./src/lexicons/com/atproto/sync.ts","./src/lexicons/com/atproto/sync/subscribeRepos.defs.ts","./src/lexicons/com/atproto/sync/subscribeRepos.ts","./src/runner/consecutive-list.ts","./src/runner/index.ts","./src/runner/memory-runner.ts","./src/runner/types.ts"],"version":"6.0.3"}
|
package/tsconfig.tests.json
CHANGED
package/jest.config.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** @type {import('jest').Config} */
|
|
2
|
-
module.exports = {
|
|
3
|
-
displayName: 'Sync',
|
|
4
|
-
transform: { '^.+\\.ts$': '@swc/jest' },
|
|
5
|
-
testTimeout: 60000,
|
|
6
|
-
setupFiles: ['<rootDir>/../../jest.setup.ts'],
|
|
7
|
-
moduleNameMapper: { '^(\\.\\.?\\/.+)\\.js$': ['$1.ts', '$1.js'] },
|
|
8
|
-
}
|