@atproto/bsync 0.0.38 → 0.0.40
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 +19 -0
- package/dist/context.d.ts +5 -5
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js.map +1 -1
- package/dist/db/index.d.ts +3 -4
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/index.js.map +1 -1
- package/dist/routes/add-mute-operation.d.ts +1 -1
- package/dist/routes/add-mute-operation.d.ts.map +1 -1
- package/dist/routes/add-notif-operation.d.ts +1 -1
- package/dist/routes/add-notif-operation.d.ts.map +1 -1
- package/dist/routes/delete-operations.d.ts +1 -1
- package/dist/routes/delete-operations.d.ts.map +1 -1
- package/dist/routes/index.d.ts +1 -1
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/put-operation.d.ts +1 -1
- package/dist/routes/put-operation.d.ts.map +1 -1
- package/dist/routes/scan-mute-operations.d.ts +1 -1
- package/dist/routes/scan-mute-operations.d.ts.map +1 -1
- package/dist/routes/scan-notif-operations.d.ts +1 -1
- package/dist/routes/scan-notif-operations.d.ts.map +1 -1
- package/dist/routes/scan-operations.d.ts +1 -1
- package/dist/routes/scan-operations.d.ts.map +1 -1
- package/package.json +4 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atproto/bsync
|
|
2
2
|
|
|
3
|
+
## 0.0.40
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`b66870d`](https://github.com/bluesky-social/atproto/commit/b66870d5a1efbcfa0cc07498c7cfcf3f0f243e86), [`b66870d`](https://github.com/bluesky-social/atproto/commit/b66870d5a1efbcfa0cc07498c7cfcf3f0f243e86)]:
|
|
8
|
+
- @atproto/common@0.7.6
|
|
9
|
+
|
|
10
|
+
## 0.0.39
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#5340](https://github.com/bluesky-social/atproto/pull/5340) [`8145a99`](https://github.com/bluesky-social/atproto/commit/8145a999e03219e846ae4773ec66f0de72939511) Thanks [@43081j](https://github.com/43081j)! - Remove typed-emitter and use built-in strongly typed `EventEmitter`
|
|
15
|
+
|
|
16
|
+
- [#5327](https://github.com/bluesky-social/atproto/pull/5327) [`c677bf3`](https://github.com/bluesky-social/atproto/commit/c677bf393d666bd20fc89c7386448f06375aba9c) Thanks [@rafaeleyng](https://github.com/rafaeleyng)! - Update bsync service image
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [[`8b55a4a`](https://github.com/bluesky-social/atproto/commit/8b55a4ab69c24e5038f67c479b3b9953666ea0c2)]:
|
|
19
|
+
- @atproto/syntax@0.7.4
|
|
20
|
+
- @atproto/common@0.7.5
|
|
21
|
+
|
|
3
22
|
## 0.0.38
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/dist/context.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { EventEmitter } from 'node:events';
|
|
2
2
|
import type { ServerConfig } from './config.js';
|
|
3
3
|
import { Database } from './db/index.js';
|
|
4
4
|
import type { createMuteOpChannel } from './db/schema/mute_op.js';
|
|
@@ -13,13 +13,13 @@ export declare class AppContext {
|
|
|
13
13
|
db: Database;
|
|
14
14
|
cfg: ServerConfig;
|
|
15
15
|
shutdown: AbortSignal;
|
|
16
|
-
events:
|
|
16
|
+
events: EventEmitter<AppEvents>;
|
|
17
17
|
constructor(opts: AppContextOptions);
|
|
18
18
|
static fromConfig(cfg: ServerConfig, shutdown: AbortSignal, overrides?: Partial<AppContextOptions>): Promise<AppContext>;
|
|
19
19
|
}
|
|
20
20
|
export type AppEvents = {
|
|
21
|
-
[createMuteOpChannel]:
|
|
22
|
-
[createNotifOpChannel]:
|
|
23
|
-
[createOperationChannel]:
|
|
21
|
+
[createMuteOpChannel]: [];
|
|
22
|
+
[createNotifOpChannel]: [];
|
|
23
|
+
[createOperationChannel]: [];
|
|
24
24
|
};
|
|
25
25
|
//# sourceMappingURL=context.d.ts.map
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AACnE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAEtE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,QAAQ,CAAA;IACZ,GAAG,EAAE,YAAY,CAAA;IACjB,QAAQ,EAAE,WAAW,CAAA;CACtB,CAAA;AAED,qBAAa,UAAU;IACrB,EAAE,EAAE,QAAQ,CAAA;IACZ,GAAG,EAAE,YAAY,CAAA;IACjB,QAAQ,EAAE,WAAW,CAAA;IACrB,MAAM,EAAE,YAAY,CAAC,SAAS,CAAC,CAAA;IAE/B,YAAY,IAAI,EAAE,iBAAiB,EAKlC;IAED,OAAa,UAAU,CACrB,GAAG,EAAE,YAAY,EACjB,QAAQ,EAAE,WAAW,EACrB,SAAS,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GACrC,OAAO,CAAC,UAAU,CAAC,CASrB;CACF;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,mBAAmB,CAAC,EAAE,EAAE,CAAA;IACzB,CAAC,oBAAoB,CAAC,EAAE,EAAE,CAAA;IAC1B,CAAC,sBAAsB,CAAC,EAAE,EAAE,CAAA;CAC7B,CAAA"}
|
package/dist/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAWxC,MAAM,OAAO,UAAU;IAMrB,YAAY,IAAuB;QACjC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAA;QACjB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAA;QACnB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;QAC7B,IAAI,CAAC,MAAM,GAAG,IAAI,YAAY,EAAa,CAAA;IAC7C,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,UAAU,CACrB,GAAiB,EACjB,QAAqB,EACrB,SAAsC;QAEtC,MAAM,EAAE,GAAG,IAAI,QAAQ,CAAC;YACtB,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG;YACf,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,MAAM;YACrB,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC,QAAQ;YACzB,WAAW,EAAE,GAAG,CAAC,EAAE,CAAC,WAAW;YAC/B,iBAAiB,EAAE,GAAG,CAAC,EAAE,CAAC,iBAAiB;SAC5C,CAAC,CAAA;QACF,OAAO,IAAI,UAAU,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,CAAC,CAAA;IAC5D,CAAC;CACF","sourcesContent":["import { EventEmitter } from 'node:events'\nimport type { ServerConfig } from './config.js'\nimport { Database } from './db/index.js'\nimport type { createMuteOpChannel } from './db/schema/mute_op.js'\nimport type { createNotifOpChannel } from './db/schema/notif_op.js'\nimport type { createOperationChannel } from './db/schema/operation.js'\n\nexport type AppContextOptions = {\n db: Database\n cfg: ServerConfig\n shutdown: AbortSignal\n}\n\nexport class AppContext {\n db: Database\n cfg: ServerConfig\n shutdown: AbortSignal\n events: EventEmitter<AppEvents>\n\n constructor(opts: AppContextOptions) {\n this.db = opts.db\n this.cfg = opts.cfg\n this.shutdown = opts.shutdown\n this.events = new EventEmitter<AppEvents>()\n }\n\n static async fromConfig(\n cfg: ServerConfig,\n shutdown: AbortSignal,\n overrides?: Partial<AppContextOptions>,\n ): Promise<AppContext> {\n const db = new Database({\n url: cfg.db.url,\n schema: cfg.db.schema,\n poolSize: cfg.db.poolSize,\n poolMaxUses: cfg.db.poolMaxUses,\n poolIdleTimeoutMs: cfg.db.poolIdleTimeoutMs,\n })\n return new AppContext({ db, cfg, shutdown, ...overrides })\n }\n}\n\nexport type AppEvents = {\n [createMuteOpChannel]: []\n [createNotifOpChannel]: []\n [createOperationChannel]: []\n}\n"]}
|
package/dist/db/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { EventEmitter } from 'node:events';
|
|
1
2
|
import { Migrator } from 'kysely/migration';
|
|
2
3
|
declare const PgPool: typeof import("pg").Pool;
|
|
3
4
|
type PgPool = InstanceType<typeof PgPool>;
|
|
4
|
-
import type TypedEmitter from 'typed-emitter';
|
|
5
5
|
import type { DatabaseSchema } from './schema/index.js';
|
|
6
6
|
import type { PgOptions } from './types.js';
|
|
7
7
|
export declare class Database {
|
|
@@ -9,7 +9,7 @@ export declare class Database {
|
|
|
9
9
|
pool: PgPool;
|
|
10
10
|
db: DatabaseSchema;
|
|
11
11
|
migrator: Migrator;
|
|
12
|
-
txEvt:
|
|
12
|
+
txEvt: EventEmitter<TxnEvents>;
|
|
13
13
|
destroyed: boolean;
|
|
14
14
|
constructor(opts: PgOptions, instances?: {
|
|
15
15
|
db: DatabaseSchema;
|
|
@@ -26,8 +26,7 @@ export declare class Database {
|
|
|
26
26
|
migrateToLatestOrThrow(): Promise<import("kysely/migration").MigrationResult[]>;
|
|
27
27
|
}
|
|
28
28
|
export default Database;
|
|
29
|
-
type TxnEmitter = TypedEmitter.default<TxnEvents>;
|
|
30
29
|
type TxnEvents = {
|
|
31
|
-
commit:
|
|
30
|
+
commit: [];
|
|
32
31
|
};
|
|
33
32
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/db/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/db/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/db/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAW1C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAE3C,QAAA,MAAc,MAAM,0BAAuB,CAAA;AAC3C,KAAK,MAAM,GAAG,YAAY,CAAC,OAAO,MAAM,CAAC,CAAA;AAIzC,OAAO,KAAK,EAAE,cAAc,EAAsB,MAAM,mBAAmB,CAAA;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3C,qBAAa,QAAQ;IAQV,IAAI,EAAE,SAAS;IAPxB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,cAAc,CAAA;IAClB,QAAQ,EAAE,QAAQ,CAAA;IAClB,KAAK,0BAAgC;IACrC,SAAS,UAAQ;IAEjB,YACS,IAAI,EAAE,SAAS,EACtB,SAAS,CAAC,EAAE;QAAE,EAAE,EAAE,cAAc,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAgDjD;IAED,IAAI,MAAM,IAAI,MAAM,GAAG,SAAS,CAE/B;IAED,IAAI,aAAa,YAEhB;IAED,iBAAiB,SAEhB;IAED,oBAAoB,SAEnB;IA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C,CAAC,WAAW,EAAE,CAAC,OAAO,EAAE,CAAA;QACxE,CAAC;QACD,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAA;QAChE,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,KAAK,CAAA;QACb,CAAC;QACD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAA;QAChE,CAAC;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;CACF;AAED,eAAe,QAAQ,CAAA;AAEvB,MAAM,WAAW,GAAG,CAAC,GAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,eAAe,CAAC,CAAA;AAC5E,MAAM,aAAa,GAAG,CAAC,GAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,iBAAiB,CAAC,CAAA;AAEhF,QAAQ;AACR,UAAU;AAEV,MAAM,aAAa;IAAnB;QACU,WAAM,GAAG,KAAK,CAAA;IAkBxB,CAAC;IAhBC,KAAK;QACH,IAAI,CAAC,MAAM,GAAG,IAAI,CAAA;IACpB,CAAC;IAED,cAAc,CAAC,IAA8B;QAC3C,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAA;QACtC,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAA;IAClB,CAAC;IAED,KAAK,CAAC,eAAe,CACnB,IAA+B;QAE/B,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;CACF;AAQD,MAAM,SAAS,GAAG,KAAK,IAAI,EAAE,GAAE,CAAC,CAAA","sourcesContent":["import assert from 'node:assert'\nimport { EventEmitter } from 'node:events'\nimport {\n Kysely,\n type KyselyPlugin,\n type PluginTransformQueryArgs,\n type PluginTransformResultArgs,\n PostgresDialect,\n type QueryResult,\n type RootOperationNode,\n type UnknownRow,\n} from 'kysely'\nimport { Migrator } from 'kysely/migration'\nimport pg from 'pg'\nconst { Pool: PgPool, types: pgTypes } = pg\ntype PgPool = InstanceType<typeof PgPool>\nimport type TypedEmitter from 'typed-emitter'\nimport { dbLogger } from '../logger.js'\nimport * as migrations from './migrations/index.js'\nimport { DbMigrationProvider } from './migrations/provider.js'\nimport type { DatabaseSchema, DatabaseSchemaType } from './schema/index.js'\nimport type { PgOptions } from './types.js'\n\nexport class Database {\n pool: PgPool\n db: DatabaseSchema\n migrator: Migrator\n txEvt = new EventEmitter() as TxnEmitter\n destroyed = false\n\n constructor(\n public opts: PgOptions,\n instances?: { db: DatabaseSchema; pool: PgPool },\n ) {\n // if instances are provided, use those\n if (instances) {\n this.db = instances.db\n this.pool = instances.pool\n } else {\n // else create a pool & connect\n const { schema, url } = opts\n const pool =\n opts.pool ??\n new PgPool({\n connectionString: url,\n max: opts.poolSize,\n maxUses: opts.poolMaxUses,\n idleTimeoutMillis: opts.poolIdleTimeoutMs,\n })\n\n // Select count(*) and other pg bigints as js integer\n pgTypes.setTypeParser(pgTypes.builtins.INT8, (n) => parseInt(n, 10))\n\n // Setup schema usage, primarily for test parallelism (each test suite runs in its own pg schema)\n if (schema && !/^[a-z_]+$/i.test(schema)) {\n throw new Error(\n `Postgres schema must only contain [A-Za-z_]: ${schema}`,\n )\n }\n\n pool.on('error', onPoolError)\n pool.on('connect', (client) => {\n client.on('error', onClientError)\n if (schema) {\n // Shared objects such as extensions will go in the public schema\n client.query(`SET search_path TO \"${schema}\",public;`)\n }\n })\n\n this.pool = pool\n this.db = new Kysely<DatabaseSchemaType>({\n dialect: new PostgresDialect({ pool }),\n })\n }\n\n this.migrator = new Migrator({\n db: this.db,\n migrationTableSchema: opts.schema,\n provider: new DbMigrationProvider(migrations),\n })\n }\n\n get schema(): string | undefined {\n return this.opts.schema\n }\n\n get isTransaction() {\n return this.db.isTransaction\n }\n\n assertTransaction() {\n assert(this.isTransaction, 'Transaction required')\n }\n\n assertNotTransaction() {\n assert(!this.isTransaction, 'Cannot be in a transaction')\n }\n\n async transaction<T>(fn: (db: Database) => Promise<T>): Promise<T> {\n const leakyTxPlugin = new LeakyTxPlugin()\n const { dbTxn, txRes } = await this.db\n .withPlugin(leakyTxPlugin)\n .transaction()\n .execute(async (txn) => {\n const dbTxn = new Database(this.opts, {\n db: txn,\n pool: this.pool,\n })\n const txRes = await fn(dbTxn)\n .catch(async (err) => {\n leakyTxPlugin.endTx()\n // ensure that all in-flight queries are flushed & the connection is open\n await dbTxn.db.getExecutor().provideConnection(noopAsync)\n throw err\n })\n .finally(() => leakyTxPlugin.endTx())\n return { dbTxn, txRes }\n })\n dbTxn?.txEvt.emit('commit')\n return txRes\n }\n\n onCommit(fn: () => void) {\n this.assertTransaction()\n this.txEvt.once('commit', fn)\n }\n\n async close(): Promise<void> {\n if (this.destroyed) return\n await this.db.destroy()\n this.destroyed = true\n }\n\n async migrateToOrThrow(migration: string) {\n if (this.schema) {\n await this.db.schema.createSchema(this.schema).ifNotExists().execute()\n }\n const { error, results } = await this.migrator.migrateTo(migration)\n if (error) {\n throw error\n }\n if (!results) {\n throw new Error('An unknown failure occurred while migrating')\n }\n return results\n }\n\n async migrateToLatestOrThrow() {\n if (this.schema) {\n await this.db.schema.createSchema(this.schema).ifNotExists().execute()\n }\n const { error, results } = await this.migrator.migrateToLatest()\n if (error) {\n throw error\n }\n if (!results) {\n throw new Error('An unknown failure occurred while migrating')\n }\n return results\n }\n}\n\nexport default Database\n\nconst onPoolError = (err: Error) => dbLogger.error({ err }, 'db pool error')\nconst onClientError = (err: Error) => dbLogger.error({ err }, 'db client error')\n\n// utils\n// -------\n\nclass LeakyTxPlugin implements KyselyPlugin {\n private txOver = false\n\n endTx() {\n this.txOver = true\n }\n\n transformQuery(args: PluginTransformQueryArgs): RootOperationNode {\n if (this.txOver) {\n throw new Error('tx already failed')\n }\n return args.node\n }\n\n async transformResult(\n args: PluginTransformResultArgs,\n ): Promise<QueryResult<UnknownRow>> {\n return args.result\n }\n}\n\ntype TxnEmitter = TypedEmitter.default<TxnEvents>\n\ntype TxnEvents = {\n commit: () => void\n}\n\nconst noopAsync = async () => {}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/db/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EACL,MAAM,EAIN,eAAe,GAIhB,MAAM,QAAQ,CAAA;AACf,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,CAAA;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAI9D,MAAM,OAAO,QAAQ;IAOnB,YACS,IAAe,EACtB,SAAgD;QADzC,SAAI,GAAJ,IAAI,CAAW;QAJxB,UAAK,GAAG,IAAI,YAAY,EAAa,CAAA;QACrC,cAAS,GAAG,KAAK,CAAA;QAMf,uCAAuC;QACvC,IAAI,SAAS,EAAE,CAAC;YACd,IAAI,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,CAAA;YACtB,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAA;QAC5B,CAAC;aAAM,CAAC;YACN,+BAA+B;YAC/B,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;YAC5B,MAAM,IAAI,GACR,IAAI,CAAC,IAAI;gBACT,IAAI,MAAM,CAAC;oBACT,gBAAgB,EAAE,GAAG;oBACrB,GAAG,EAAE,IAAI,CAAC,QAAQ;oB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CAAC,CAAA;QAChE,CAAC;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;CACF;AAED,eAAe,QAAQ,CAAA;AAEvB,MAAM,WAAW,GAAG,CAAC,GAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,eAAe,CAAC,CAAA;AAC5E,MAAM,aAAa,GAAG,CAAC,GAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,iBAAiB,CAAC,CAAA;AAEhF,QAAQ;AACR,UAAU;AAEV,MAAM,aAAa;IAAnB;QACU,WAAM,GAAG,KAAK,CAAA;IAkBxB,CAAC;IAhBC,KAAK;QACH,IAAI,CAAC,MAAM,GAAG,IAAI,CAAA;IACpB,CAAC;IAED,cAAc,CAAC,IAA8B;QAC3C,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAA;QACtC,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAA;IAClB,CAAC;IAED,KAAK,CAAC,eAAe,CACnB,IAA+B;QAE/B,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;CACF;AAMD,MAAM,SAAS,GAAG,KAAK,IAAI,EAAE,GAAE,CAAC,CAAA","sourcesContent":["import assert from 'node:assert'\nimport { EventEmitter } from 'node:events'\nimport {\n Kysely,\n type KyselyPlugin,\n type PluginTransformQueryArgs,\n type PluginTransformResultArgs,\n PostgresDialect,\n type QueryResult,\n type RootOperationNode,\n type UnknownRow,\n} from 'kysely'\nimport { Migrator } from 'kysely/migration'\nimport pg from 'pg'\nconst { Pool: PgPool, types: pgTypes } = pg\ntype PgPool = InstanceType<typeof PgPool>\nimport { dbLogger } from '../logger.js'\nimport * as migrations from './migrations/index.js'\nimport { DbMigrationProvider } from './migrations/provider.js'\nimport type { DatabaseSchema, DatabaseSchemaType } from './schema/index.js'\nimport type { PgOptions } from './types.js'\n\nexport class Database {\n pool: PgPool\n db: DatabaseSchema\n migrator: Migrator\n txEvt = new EventEmitter<TxnEvents>()\n destroyed = false\n\n constructor(\n public opts: PgOptions,\n instances?: { db: DatabaseSchema; pool: PgPool },\n ) {\n // if instances are provided, use those\n if (instances) {\n this.db = instances.db\n this.pool = instances.pool\n } else {\n // else create a pool & connect\n const { schema, url } = opts\n const pool =\n opts.pool ??\n new PgPool({\n connectionString: url,\n max: opts.poolSize,\n maxUses: opts.poolMaxUses,\n idleTimeoutMillis: opts.poolIdleTimeoutMs,\n })\n\n // Select count(*) and other pg bigints as js integer\n pgTypes.setTypeParser(pgTypes.builtins.INT8, (n) => parseInt(n, 10))\n\n // Setup schema usage, primarily for test parallelism (each test suite runs in its own pg schema)\n if (schema && !/^[a-z_]+$/i.test(schema)) {\n throw new Error(\n `Postgres schema must only contain [A-Za-z_]: ${schema}`,\n )\n }\n\n pool.on('error', onPoolError)\n pool.on('connect', (client) => {\n client.on('error', onClientError)\n if (schema) {\n // Shared objects such as extensions will go in the public schema\n client.query(`SET search_path TO \"${schema}\",public;`)\n }\n })\n\n this.pool = pool\n this.db = new Kysely<DatabaseSchemaType>({\n dialect: new PostgresDialect({ pool }),\n })\n }\n\n this.migrator = new Migrator({\n db: this.db,\n migrationTableSchema: opts.schema,\n provider: new DbMigrationProvider(migrations),\n })\n }\n\n get schema(): string | undefined {\n return this.opts.schema\n }\n\n get isTransaction() {\n return this.db.isTransaction\n }\n\n assertTransaction() {\n assert(this.isTransaction, 'Transaction required')\n }\n\n assertNotTransaction() {\n assert(!this.isTransaction, 'Cannot be in a transaction')\n }\n\n async transaction<T>(fn: (db: Database) => Promise<T>): Promise<T> {\n const leakyTxPlugin = new LeakyTxPlugin()\n const { dbTxn, txRes } = await this.db\n .withPlugin(leakyTxPlugin)\n .transaction()\n .execute(async (txn) => {\n const dbTxn = new Database(this.opts, {\n db: txn,\n pool: this.pool,\n })\n const txRes = await fn(dbTxn)\n .catch(async (err) => {\n leakyTxPlugin.endTx()\n // ensure that all in-flight queries are flushed & the connection is open\n await dbTxn.db.getExecutor().provideConnection(noopAsync)\n throw err\n })\n .finally(() => leakyTxPlugin.endTx())\n return { dbTxn, txRes }\n })\n dbTxn?.txEvt.emit('commit')\n return txRes\n }\n\n onCommit(fn: () => void) {\n this.assertTransaction()\n this.txEvt.once('commit', fn)\n }\n\n async close(): Promise<void> {\n if (this.destroyed) return\n await this.db.destroy()\n this.destroyed = true\n }\n\n async migrateToOrThrow(migration: string) {\n if (this.schema) {\n await this.db.schema.createSchema(this.schema).ifNotExists().execute()\n }\n const { error, results } = await this.migrator.migrateTo(migration)\n if (error) {\n throw error\n }\n if (!results) {\n throw new Error('An unknown failure occurred while migrating')\n }\n return results\n }\n\n async migrateToLatestOrThrow() {\n if (this.schema) {\n await this.db.schema.createSchema(this.schema).ifNotExists().execute()\n }\n const { error, results } = await this.migrator.migrateToLatest()\n if (error) {\n throw error\n }\n if (!results) {\n throw new Error('An unknown failure occurred while migrating')\n }\n return results\n }\n}\n\nexport default Database\n\nconst onPoolError = (err: Error) => dbLogger.error({ err }, 'db pool error')\nconst onClientError = (err: Error) => dbLogger.error({ err }, 'db client error')\n\n// utils\n// -------\n\nclass LeakyTxPlugin implements KyselyPlugin {\n private txOver = false\n\n endTx() {\n this.txOver = true\n }\n\n transformQuery(args: PluginTransformQueryArgs): RootOperationNode {\n if (this.txOver) {\n throw new Error('tx already failed')\n }\n return args.node\n }\n\n async transformResult(\n args: PluginTransformResultArgs,\n ): Promise<QueryResult<UnknownRow>> {\n return args.result\n }\n}\n\ntype TxnEvents = {\n commit: []\n}\n\nconst noopAsync = async () => {}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ServiceImpl } from '@connectrpc/connect';
|
|
2
2
|
import type { AppContext } from '../context.js';
|
|
3
3
|
import type { Service } from '../proto/bsync_connect.js';
|
|
4
|
-
declare const _default: (ctx: AppContext) => Partial<ServiceImpl<typeof Service>>;
|
|
5
4
|
export default _default;
|
|
5
|
+
declare function _default(ctx: AppContext): Partial<ServiceImpl<typeof Service>>;
|
|
6
6
|
//# sourceMappingURL=add-mute-operation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-mute-operation.d.ts","sourceRoot":"","sources":["../../src/routes/add-mute-operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAG1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAG/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA
|
|
1
|
+
{"version":3,"file":"add-mute-operation.d.ts","sourceRoot":"","sources":["../../src/routes/add-mute-operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAG1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAG/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;;0BAQxC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,OAAO,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ServiceImpl } from '@connectrpc/connect';
|
|
2
2
|
import type { AppContext } from '../context.js';
|
|
3
3
|
import type { Service } from '../proto/bsync_connect.js';
|
|
4
|
-
declare const _default: (ctx: AppContext) => Partial<ServiceImpl<typeof Service>>;
|
|
5
4
|
export default _default;
|
|
5
|
+
declare function _default(ctx: AppContext): Partial<ServiceImpl<typeof Service>>;
|
|
6
6
|
//# sourceMappingURL=add-notif-operation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-notif-operation.d.ts","sourceRoot":"","sources":["../../src/routes/add-notif-operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAE1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAG/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA
|
|
1
|
+
{"version":3,"file":"add-notif-operation.d.ts","sourceRoot":"","sources":["../../src/routes/add-notif-operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAE1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAG/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;;0BAKxC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,OAAO,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ServiceImpl } from '@connectrpc/connect';
|
|
2
2
|
import type { AppContext } from '../context.js';
|
|
3
3
|
import type { Service } from '../proto/bsync_connect.js';
|
|
4
|
-
declare const _default: (ctx: AppContext) => Partial<ServiceImpl<typeof Service>>;
|
|
5
4
|
export default _default;
|
|
5
|
+
declare function _default(ctx: AppContext): Partial<ServiceImpl<typeof Service>>;
|
|
6
6
|
//# sourceMappingURL=delete-operations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-operations.d.ts","sourceRoot":"","sources":["../../src/routes/delete-operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA
|
|
1
|
+
{"version":3,"file":"delete-operations.d.ts","sourceRoot":"","sources":["../../src/routes/delete-operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;;0BAKxC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,OAAO,CAAC,CAAC"}
|
package/dist/routes/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ConnectRouter } from '@connectrpc/connect';
|
|
2
2
|
import type { AppContext } from '../context.js';
|
|
3
|
-
declare const _default: (ctx: AppContext) => (router: ConnectRouter) => ConnectRouter;
|
|
4
3
|
export default _default;
|
|
4
|
+
declare function _default(ctx: AppContext): (router: ConnectRouter) => ConnectRouter;
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/routes/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/routes/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;;0BAU/B,GAAG,EAAE,UAAU,YAAc,aAAa"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ServiceImpl } from '@connectrpc/connect';
|
|
2
2
|
import type { AppContext } from '../context.js';
|
|
3
3
|
import type { Service } from '../proto/bsync_connect.js';
|
|
4
|
-
declare const _default: (ctx: AppContext) => Partial<ServiceImpl<typeof Service>>;
|
|
5
4
|
export default _default;
|
|
5
|
+
declare function _default(ctx: AppContext): Partial<ServiceImpl<typeof Service>>;
|
|
6
6
|
//# sourceMappingURL=put-operation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"put-operation.d.ts","sourceRoot":"","sources":["../../src/routes/put-operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAG1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAM/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA
|
|
1
|
+
{"version":3,"file":"put-operation.d.ts","sourceRoot":"","sources":["../../src/routes/put-operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAG1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAM/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;;0BASxC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,OAAO,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ServiceImpl } from '@connectrpc/connect';
|
|
2
2
|
import type { AppContext } from '../context.js';
|
|
3
3
|
import type { Service } from '../proto/bsync_connect.js';
|
|
4
|
-
declare const _default: (ctx: AppContext) => Partial<ServiceImpl<typeof Service>>;
|
|
5
4
|
export default _default;
|
|
5
|
+
declare function _default(ctx: AppContext): Partial<ServiceImpl<typeof Service>>;
|
|
6
6
|
//# sourceMappingURL=scan-mute-operations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scan-mute-operations.d.ts","sourceRoot":"","sources":["../../src/routes/scan-mute-operations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA
|
|
1
|
+
{"version":3,"file":"scan-mute-operations.d.ts","sourceRoot":"","sources":["../../src/routes/scan-mute-operations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;;0BAKxC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,OAAO,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ServiceImpl } from '@connectrpc/connect';
|
|
2
2
|
import type { AppContext } from '../context.js';
|
|
3
3
|
import type { Service } from '../proto/bsync_connect.js';
|
|
4
|
-
declare const _default: (ctx: AppContext) => Partial<ServiceImpl<typeof Service>>;
|
|
5
4
|
export default _default;
|
|
5
|
+
declare function _default(ctx: AppContext): Partial<ServiceImpl<typeof Service>>;
|
|
6
6
|
//# sourceMappingURL=scan-notif-operations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scan-notif-operations.d.ts","sourceRoot":"","sources":["../../src/routes/scan-notif-operations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA
|
|
1
|
+
{"version":3,"file":"scan-notif-operations.d.ts","sourceRoot":"","sources":["../../src/routes/scan-notif-operations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;;0BAKxC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,OAAO,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ServiceImpl } from '@connectrpc/connect';
|
|
2
2
|
import type { AppContext } from '../context.js';
|
|
3
3
|
import type { Service } from '../proto/bsync_connect.js';
|
|
4
|
-
declare const _default: (ctx: AppContext) => Partial<ServiceImpl<typeof Service>>;
|
|
5
4
|
export default _default;
|
|
5
|
+
declare function _default(ctx: AppContext): Partial<ServiceImpl<typeof Service>>;
|
|
6
6
|
//# sourceMappingURL=scan-operations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scan-operations.d.ts","sourceRoot":"","sources":["../../src/routes/scan-operations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA
|
|
1
|
+
{"version":3,"file":"scan-operations.d.ts","sourceRoot":"","sources":["../../src/routes/scan-operations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;;0BAKxC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,OAAO,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/bsync",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.40",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Sychronizing service for app.bsky App View (Bluesky API)",
|
|
6
6
|
"keywords": [
|
|
@@ -36,9 +36,8 @@
|
|
|
36
36
|
"kysely": "^0.29.2",
|
|
37
37
|
"pg": "^8.10.0",
|
|
38
38
|
"pino-http": "^11.0.0",
|
|
39
|
-
"
|
|
40
|
-
"@atproto/
|
|
41
|
-
"@atproto/syntax": "^0.7.3"
|
|
39
|
+
"@atproto/common": "^0.7.6",
|
|
40
|
+
"@atproto/syntax": "^0.7.4"
|
|
42
41
|
},
|
|
43
42
|
"devDependencies": {
|
|
44
43
|
"@bufbuild/buf": "^1.28.1",
|
|
@@ -51,7 +50,7 @@
|
|
|
51
50
|
"scripts": {
|
|
52
51
|
"codegen:buf": "buf generate proto",
|
|
53
52
|
"prebuild": "pnpm run '/^(codegen:.+)$/'",
|
|
54
|
-
"build": "
|
|
53
|
+
"build": "tsc --build tsconfig.build.json",
|
|
55
54
|
"start": "node --enable-source-maps dist/bin.js",
|
|
56
55
|
"test": "NODE_OPTIONS=--experimental-vm-modules ../dev-infra/with-test-db.sh jest",
|
|
57
56
|
"test:log": "tail -50 test.log | pino-pretty",
|