@atproto/bsync 0.0.26-next.0 → 0.0.27
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 +18 -9
- package/buf.gen.yaml +1 -1
- package/dist/context.d.ts +2 -2
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js.map +1 -1
- package/dist/db/index.d.ts +1 -1
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/index.js.map +1 -1
- package/dist/proto/bsync_connect.js +1 -1
- package/dist/proto/bsync_connect.js.map +1 -1
- package/jest.config.cjs +9 -2
- package/package.json +6 -4
- package/src/context.ts +3 -3
- package/src/db/index.ts +1 -1
- package/tsconfig.build.json +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/tsconfig.tests.json +1 -1
- package/src/proto/bsync_connect.ts +0 -93
- package/src/proto/bsync_pb.ts +0 -909
package/CHANGELOG.md
CHANGED
|
@@ -1,22 +1,31 @@
|
|
|
1
1
|
# @atproto/bsync
|
|
2
2
|
|
|
3
|
-
## 0.0.
|
|
3
|
+
## 0.0.27
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
- [#
|
|
7
|
+
- [#4964](https://github.com/bluesky-social/atproto/pull/4964) [`571582e`](https://github.com/bluesky-social/atproto/commit/571582ea9b1aea56938b8f24daaf49e197a987ef) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Remove proto buf generated code from version control
|
|
8
8
|
|
|
9
|
-
- [#
|
|
9
|
+
- [#4960](https://github.com/bluesky-social/atproto/pull/4960) [`53b1e07`](https://github.com/bluesky-social/atproto/commit/53b1e0731ee0d13c350dd96cbcab88447eaad441) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Update protobuf to add `.js` extension
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
- Updated dependencies [[`e6c6343`](https://github.com/bluesky-social/atproto/commit/e6c6343bd3727455bd0da12300bb4929a944e4f1)]:
|
|
12
|
+
- @atproto/common@0.6.1
|
|
13
|
+
|
|
14
|
+
## 0.0.26
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
12
17
|
|
|
13
|
-
- [#
|
|
18
|
+
- [#4929](https://github.com/bluesky-social/atproto/pull/4929) [`f01c59f`](https://github.com/bluesky-social/atproto/commit/f01c59f5bd3f75fb8b47a9eecd4858b84033fb7c) Thanks [@devinivy](https://github.com/devinivy)! - **BREAKING:** Drop support for Node.js 18 and 20. Node.js 22 is now the minimum supported version. Docker images now use Node.js 24.
|
|
19
|
+
|
|
20
|
+
- [#4943](https://github.com/bluesky-social/atproto/pull/4943) [`c459153`](https://github.com/bluesky-social/atproto/commit/c459153395a30ce89e050892c8fab7dc98e019b9) Thanks [@devinivy](https://github.com/devinivy)! - **BREAKING:** Convert to pure ESM. All packages now ship `"type": "module"` with ES module output and Node16 module resolution.
|
|
21
|
+
|
|
22
|
+
Node.js 22's `require()` compatibility layer can still load these packages in CommonJS code.
|
|
14
23
|
|
|
15
|
-
|
|
24
|
+
- [#4930](https://github.com/bluesky-social/atproto/pull/4930) [`908bece`](https://github.com/bluesky-social/atproto/commit/908bece169258bff5ad121e5eec157d6ded6f705) Thanks [@devinivy](https://github.com/devinivy)! - Build with TypeScript 6.0.
|
|
16
25
|
|
|
17
|
-
- Updated dependencies [[`
|
|
18
|
-
- @atproto/common@0.6.0
|
|
19
|
-
- @atproto/syntax@0.6.0
|
|
26
|
+
- Updated dependencies [[`affb50c`](https://github.com/bluesky-social/atproto/commit/affb50c040b497a12631df99a6310f8e78cab557), [`f01c59f`](https://github.com/bluesky-social/atproto/commit/f01c59f5bd3f75fb8b47a9eecd4858b84033fb7c), [`c459153`](https://github.com/bluesky-social/atproto/commit/c459153395a30ce89e050892c8fab7dc98e019b9), [`908bece`](https://github.com/bluesky-social/atproto/commit/908bece169258bff5ad121e5eec157d6ded6f705)]:
|
|
27
|
+
- @atproto/common@0.6.0
|
|
28
|
+
- @atproto/syntax@0.6.0
|
|
20
29
|
|
|
21
30
|
## 0.0.25
|
|
22
31
|
|
package/buf.gen.yaml
CHANGED
package/dist/context.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type TypedEmitter from 'typed-emitter';
|
|
2
2
|
import { ServerConfig } from './config.js';
|
|
3
3
|
import { Database } from './db/index.js';
|
|
4
4
|
import { createMuteOpChannel } from './db/schema/mute_op.js';
|
|
@@ -13,7 +13,7 @@ export declare class AppContext {
|
|
|
13
13
|
db: Database;
|
|
14
14
|
cfg: ServerConfig;
|
|
15
15
|
shutdown: AbortSignal;
|
|
16
|
-
events:
|
|
16
|
+
events: TypedEmitter.default<AppEvents>;
|
|
17
17
|
constructor(opts: AppContextOptions);
|
|
18
18
|
static fromConfig(cfg: ServerConfig, shutdown: AbortSignal, overrides?: Partial<AppContextOptions>): Promise<AppContext>;
|
|
19
19
|
}
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,YAAY,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAEjE,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,OAAO,CAAC,SAAS,CAAC,CAAA;gBAE3B,IAAI,EAAE,iBAAiB;WAOtB,UAAU,CACrB,GAAG,EAAE,YAAY,EACjB,QAAQ,EAAE,WAAW,EACrB,SAAS,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GACrC,OAAO,CAAC,UAAU,CAAC;CAUvB;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAA;IACjC,CAAC,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAA;IAClC,CAAC,sBAAsB,CAAC,EAAE,MAAM,IAAI,CAAA;CACrC,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;AAG1C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAQjE,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,
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAG1C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAQjE,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,EAAqC,CAAA;IACrE,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 TypedEmitter from 'typed-emitter'\nimport { ServerConfig } from './config.js'\nimport { Database } from './db/index.js'\nimport { createMuteOpChannel } from './db/schema/mute_op.js'\nimport { createNotifOpChannel } from './db/schema/notif_op.js'\nimport { 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: TypedEmitter.default<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() as TypedEmitter.default<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]: () => void\n [createNotifOpChannel]: () => void\n [createOperationChannel]: () => void\n}\n"]}
|
package/dist/db/index.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export declare class Database {
|
|
|
27
27
|
migrateToLatestOrThrow(): Promise<import("kysely").MigrationResult[]>;
|
|
28
28
|
}
|
|
29
29
|
export default Database;
|
|
30
|
-
type TxnEmitter = TypedEmitter<TxnEvents>;
|
|
30
|
+
type TxnEmitter = TypedEmitter.default<TxnEvents>;
|
|
31
31
|
type TxnEvents = {
|
|
32
32
|
commit: () => void;
|
|
33
33
|
};
|
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":"AAEA,OAAO,EAGL,QAAQ,EAOT,MAAM,QAAQ,CAAA;AAEf,OAAO,EAAE,MAAM,IAAI,CAAA;AAEnB,QAAA,MAAc,MAAM,gBAAuB,CAAA;AAC3C,KAAK,MAAM,GAAG,YAAY,CAAC,OAAO,MAAM,CAAC,CAAA;AACzC,OAAO,KAAK,YAAY,MAAM,eAAe,C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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 KyselyPlugin,\n Migrator,\n PluginTransformQueryArgs,\n PluginTransformResultArgs,\n PostgresDialect,\n QueryResult,\n RootOperationNode,\n UnknownRow,\n} from 'kysely'\n// eslint-disable-next-line import/default\nimport pg from 'pg'\n// eslint-disable-next-line import/no-named-as-default-member\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 { DatabaseSchema, DatabaseSchemaType } from './schema/index.js'\nimport { 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<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,EAEN,QAAQ,EAGR,eAAe,GAIhB,MAAM,QAAQ,CAAA;AACf,0CAA0C;AAC1C,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,6DAA6D;AAC7D,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,CAAA;AAG3C,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;IA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/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 KyselyPlugin,\n Migrator,\n PluginTransformQueryArgs,\n PluginTransformResultArgs,\n PostgresDialect,\n QueryResult,\n RootOperationNode,\n UnknownRow,\n} from 'kysely'\n// eslint-disable-next-line import/default\nimport pg from 'pg'\n// eslint-disable-next-line import/no-named-as-default-member\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 { DatabaseSchema, DatabaseSchemaType } from './schema/index.js'\nimport { 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,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-connect-es v1.3.0 with parameter "target=ts,import_extension
|
|
1
|
+
// @generated by protoc-gen-connect-es v1.3.0 with parameter "target=ts,import_extension=.js"
|
|
2
2
|
// @generated from file bsync.proto (package bsync, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bsync_connect.js","sourceRoot":"","sources":["../../src/proto/bsync_connect.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"bsync_connect.js","sourceRoot":"","sources":["../../src/proto/bsync_connect.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,kEAAkE;AAClE,oBAAoB;AACpB,cAAc;AAEd,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,0CAA0C,EAAE,2CAA2C,EAAE,WAAW,EAAE,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACrc,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD;;GAEG;AACH,MAAM,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AAC,EAAE,YAAY;YACf,IAAI,EAAE,UAAU,CAAC,KAAK;SACvB;KACF;CACO,CAAC","sourcesContent":["// @generated by protoc-gen-connect-es v1.3.0 with parameter \"target=ts,import_extension=.js\"\n// @generated from file bsync.proto (package bsync, syntax proto3)\n/* eslint-disable */\n// @ts-nocheck\n\nimport { AddMuteOperationRequest, AddMuteOperationResponse, AddNotifOperationRequest, AddNotifOperationResponse, DeleteOperationsByActorAndNamespaceRequest, DeleteOperationsByActorAndNamespaceResponse, PingRequest, PingResponse, PutOperationRequest, PutOperationResponse, ScanMuteOperationsRequest, ScanMuteOperationsResponse, ScanNotifOperationsRequest, ScanNotifOperationsResponse, ScanOperationsRequest, ScanOperationsResponse } from \"./bsync_pb.js\";\nimport { MethodKind } from \"@bufbuild/protobuf\";\n\n/**\n * @generated from service bsync.Service\n */\nexport const Service = {\n typeName: \"bsync.Service\",\n methods: {\n /**\n * Sync\n *\n * @generated from rpc bsync.Service.AddMuteOperation\n */\n addMuteOperation: {\n name: \"AddMuteOperation\",\n I: AddMuteOperationRequest,\n O: AddMuteOperationResponse,\n kind: MethodKind.Unary,\n },\n /**\n * @generated from rpc bsync.Service.ScanMuteOperations\n */\n scanMuteOperations: {\n name: \"ScanMuteOperations\",\n I: ScanMuteOperationsRequest,\n O: ScanMuteOperationsResponse,\n kind: MethodKind.Unary,\n },\n /**\n * @generated from rpc bsync.Service.AddNotifOperation\n */\n addNotifOperation: {\n name: \"AddNotifOperation\",\n I: AddNotifOperationRequest,\n O: AddNotifOperationResponse,\n kind: MethodKind.Unary,\n },\n /**\n * @generated from rpc bsync.Service.ScanNotifOperations\n */\n scanNotifOperations: {\n name: \"ScanNotifOperations\",\n I: ScanNotifOperationsRequest,\n O: ScanNotifOperationsResponse,\n kind: MethodKind.Unary,\n },\n /**\n * @generated from rpc bsync.Service.PutOperation\n */\n putOperation: {\n name: \"PutOperation\",\n I: PutOperationRequest,\n O: PutOperationResponse,\n kind: MethodKind.Unary,\n },\n /**\n * @generated from rpc bsync.Service.ScanOperations\n */\n scanOperations: {\n name: \"ScanOperations\",\n I: ScanOperationsRequest,\n O: ScanOperationsResponse,\n kind: MethodKind.Unary,\n },\n /**\n * @generated from rpc bsync.Service.DeleteOperationsByActorAndNamespace\n */\n deleteOperationsByActorAndNamespace: {\n name: \"DeleteOperationsByActorAndNamespace\",\n I: DeleteOperationsByActorAndNamespaceRequest,\n O: DeleteOperationsByActorAndNamespaceResponse,\n kind: MethodKind.Unary,\n },\n /**\n * Ping\n *\n * @generated from rpc bsync.Service.Ping\n */\n ping: {\n name: \"Ping\",\n I: PingRequest,\n O: PingResponse,\n kind: MethodKind.Unary,\n },\n }\n} as const;\n\n"]}
|
package/jest.config.cjs
CHANGED
|
@@ -4,11 +4,18 @@ module.exports = {
|
|
|
4
4
|
transform: {
|
|
5
5
|
'^.+\\.(t|j)s$': [
|
|
6
6
|
'@swc/jest',
|
|
7
|
-
{
|
|
7
|
+
{
|
|
8
|
+
jsc: {
|
|
9
|
+
parser: { syntax: 'typescript', importAttributes: true },
|
|
10
|
+
experimental: { keepImportAttributes: true },
|
|
11
|
+
transform: {},
|
|
12
|
+
},
|
|
13
|
+
module: { type: 'es6' },
|
|
14
|
+
},
|
|
8
15
|
],
|
|
9
16
|
},
|
|
10
17
|
extensionsToTreatAsEsm: ['.ts'],
|
|
11
18
|
transformIgnorePatterns: [],
|
|
12
|
-
setupFiles: ['<rootDir>/../../
|
|
19
|
+
setupFiles: ['<rootDir>/../../test.setup.ts'],
|
|
13
20
|
moduleNameMapper: { '^(\\.\\.?\\/.+)\\.js$': ['$1.ts', '$1.js'] },
|
|
14
21
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/bsync",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.27",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Sychronizing service for app.bsky App View (Bluesky API)",
|
|
6
6
|
"keywords": [
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"pg": "^8.10.0",
|
|
26
26
|
"pino-http": "^8.2.1",
|
|
27
27
|
"typed-emitter": "^2.1.0",
|
|
28
|
-
"@atproto/common": "^0.6.
|
|
29
|
-
"@atproto/syntax": "^0.6.
|
|
28
|
+
"@atproto/common": "^0.6.1",
|
|
29
|
+
"@atproto/syntax": "^0.6.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@bufbuild/buf": "^1.28.1",
|
|
@@ -46,12 +46,14 @@
|
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
|
+
"codegen:buf": "buf generate proto",
|
|
50
|
+
"prebuild": "pnpm run '/^(codegen:.+)$/'",
|
|
49
51
|
"build": "tsc --build tsconfig.build.json",
|
|
50
52
|
"start": "node --enable-source-maps dist/bin.js",
|
|
51
53
|
"test": "NODE_OPTIONS=--experimental-vm-modules ../dev-infra/with-test-db.sh jest",
|
|
52
54
|
"test:log": "tail -50 test.log | pino-pretty",
|
|
53
55
|
"test:updateSnapshot": "jest --updateSnapshot",
|
|
54
56
|
"migration:create": "ts-node ./bin/migration-create.ts",
|
|
55
|
-
"buf:gen": "buf
|
|
57
|
+
"buf:gen": ">&2 echo 'DEPRECATED: run `pnpm run codegen:buf` instead ' && pnpm run codegen:buf"
|
|
56
58
|
}
|
|
57
59
|
}
|
package/src/context.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from 'node:events'
|
|
2
|
-
import type
|
|
2
|
+
import type TypedEmitter from 'typed-emitter'
|
|
3
3
|
import { ServerConfig } from './config.js'
|
|
4
4
|
import { Database } from './db/index.js'
|
|
5
5
|
import { createMuteOpChannel } from './db/schema/mute_op.js'
|
|
@@ -16,13 +16,13 @@ export class AppContext {
|
|
|
16
16
|
db: Database
|
|
17
17
|
cfg: ServerConfig
|
|
18
18
|
shutdown: AbortSignal
|
|
19
|
-
events:
|
|
19
|
+
events: TypedEmitter.default<AppEvents>
|
|
20
20
|
|
|
21
21
|
constructor(opts: AppContextOptions) {
|
|
22
22
|
this.db = opts.db
|
|
23
23
|
this.cfg = opts.cfg
|
|
24
24
|
this.shutdown = opts.shutdown
|
|
25
|
-
this.events = new EventEmitter() as
|
|
25
|
+
this.events = new EventEmitter() as TypedEmitter.default<AppEvents>
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
static async fromConfig(
|
package/src/db/index.ts
CHANGED
package/tsconfig.build.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/client.ts","./src/config.ts","./src/context.ts","./src/index.ts","./src/logger.ts","./src/db/index.ts","./src/db/types.ts","./src/db/migrations/
|
|
1
|
+
{"root":["./src/client.ts","./src/config.ts","./src/context.ts","./src/index.ts","./src/logger.ts","./src/db/index.ts","./src/db/types.ts","./src/db/migrations/20240108T220751294Z-init.ts","./src/db/migrations/20240717T224303472Z-notif-ops.ts","./src/db/migrations/20250527T022203400Z-add-operation.ts","./src/db/migrations/20250603T163446567Z-alter-operation.ts","./src/db/migrations/index.ts","./src/db/migrations/provider.ts","./src/db/schema/index.ts","./src/db/schema/mute_item.ts","./src/db/schema/mute_op.ts","./src/db/schema/notif_item.ts","./src/db/schema/notif_op.ts","./src/db/schema/operation.ts","./src/proto/bsync_connect.ts","./src/proto/bsync_pb.ts","./src/routes/add-mute-operation.ts","./src/routes/add-notif-operation.ts","./src/routes/auth.ts","./src/routes/delete-operations.ts","./src/routes/index.ts","./src/routes/put-operation.ts","./src/routes/scan-mute-operations.ts","./src/routes/scan-notif-operations.ts","./src/routes/scan-operations.ts","./src/routes/util.ts"],"version":"6.0.3"}
|
package/tsconfig.tests.json
CHANGED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
// @generated by protoc-gen-connect-es v1.3.0 with parameter "target=ts,import_extension="
|
|
2
|
-
// @generated from file bsync.proto (package bsync, syntax proto3)
|
|
3
|
-
/* eslint-disable */
|
|
4
|
-
// @ts-nocheck
|
|
5
|
-
|
|
6
|
-
import { AddMuteOperationRequest, AddMuteOperationResponse, AddNotifOperationRequest, AddNotifOperationResponse, DeleteOperationsByActorAndNamespaceRequest, DeleteOperationsByActorAndNamespaceResponse, PingRequest, PingResponse, PutOperationRequest, PutOperationResponse, ScanMuteOperationsRequest, ScanMuteOperationsResponse, ScanNotifOperationsRequest, ScanNotifOperationsResponse, ScanOperationsRequest, ScanOperationsResponse } from "./bsync_pb.js";
|
|
7
|
-
import { MethodKind } from "@bufbuild/protobuf";
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @generated from service bsync.Service
|
|
11
|
-
*/
|
|
12
|
-
export const Service = {
|
|
13
|
-
typeName: "bsync.Service",
|
|
14
|
-
methods: {
|
|
15
|
-
/**
|
|
16
|
-
* Sync
|
|
17
|
-
*
|
|
18
|
-
* @generated from rpc bsync.Service.AddMuteOperation
|
|
19
|
-
*/
|
|
20
|
-
addMuteOperation: {
|
|
21
|
-
name: "AddMuteOperation",
|
|
22
|
-
I: AddMuteOperationRequest,
|
|
23
|
-
O: AddMuteOperationResponse,
|
|
24
|
-
kind: MethodKind.Unary,
|
|
25
|
-
},
|
|
26
|
-
/**
|
|
27
|
-
* @generated from rpc bsync.Service.ScanMuteOperations
|
|
28
|
-
*/
|
|
29
|
-
scanMuteOperations: {
|
|
30
|
-
name: "ScanMuteOperations",
|
|
31
|
-
I: ScanMuteOperationsRequest,
|
|
32
|
-
O: ScanMuteOperationsResponse,
|
|
33
|
-
kind: MethodKind.Unary,
|
|
34
|
-
},
|
|
35
|
-
/**
|
|
36
|
-
* @generated from rpc bsync.Service.AddNotifOperation
|
|
37
|
-
*/
|
|
38
|
-
addNotifOperation: {
|
|
39
|
-
name: "AddNotifOperation",
|
|
40
|
-
I: AddNotifOperationRequest,
|
|
41
|
-
O: AddNotifOperationResponse,
|
|
42
|
-
kind: MethodKind.Unary,
|
|
43
|
-
},
|
|
44
|
-
/**
|
|
45
|
-
* @generated from rpc bsync.Service.ScanNotifOperations
|
|
46
|
-
*/
|
|
47
|
-
scanNotifOperations: {
|
|
48
|
-
name: "ScanNotifOperations",
|
|
49
|
-
I: ScanNotifOperationsRequest,
|
|
50
|
-
O: ScanNotifOperationsResponse,
|
|
51
|
-
kind: MethodKind.Unary,
|
|
52
|
-
},
|
|
53
|
-
/**
|
|
54
|
-
* @generated from rpc bsync.Service.PutOperation
|
|
55
|
-
*/
|
|
56
|
-
putOperation: {
|
|
57
|
-
name: "PutOperation",
|
|
58
|
-
I: PutOperationRequest,
|
|
59
|
-
O: PutOperationResponse,
|
|
60
|
-
kind: MethodKind.Unary,
|
|
61
|
-
},
|
|
62
|
-
/**
|
|
63
|
-
* @generated from rpc bsync.Service.ScanOperations
|
|
64
|
-
*/
|
|
65
|
-
scanOperations: {
|
|
66
|
-
name: "ScanOperations",
|
|
67
|
-
I: ScanOperationsRequest,
|
|
68
|
-
O: ScanOperationsResponse,
|
|
69
|
-
kind: MethodKind.Unary,
|
|
70
|
-
},
|
|
71
|
-
/**
|
|
72
|
-
* @generated from rpc bsync.Service.DeleteOperationsByActorAndNamespace
|
|
73
|
-
*/
|
|
74
|
-
deleteOperationsByActorAndNamespace: {
|
|
75
|
-
name: "DeleteOperationsByActorAndNamespace",
|
|
76
|
-
I: DeleteOperationsByActorAndNamespaceRequest,
|
|
77
|
-
O: DeleteOperationsByActorAndNamespaceResponse,
|
|
78
|
-
kind: MethodKind.Unary,
|
|
79
|
-
},
|
|
80
|
-
/**
|
|
81
|
-
* Ping
|
|
82
|
-
*
|
|
83
|
-
* @generated from rpc bsync.Service.Ping
|
|
84
|
-
*/
|
|
85
|
-
ping: {
|
|
86
|
-
name: "Ping",
|
|
87
|
-
I: PingRequest,
|
|
88
|
-
O: PingResponse,
|
|
89
|
-
kind: MethodKind.Unary,
|
|
90
|
-
},
|
|
91
|
-
}
|
|
92
|
-
} as const;
|
|
93
|
-
|
package/src/proto/bsync_pb.ts
DELETED
|
@@ -1,909 +0,0 @@
|
|
|
1
|
-
// @generated by protoc-gen-es v1.6.0 with parameter "target=ts,import_extension="
|
|
2
|
-
// @generated from file bsync.proto (package bsync, syntax proto3)
|
|
3
|
-
/* eslint-disable */
|
|
4
|
-
// @ts-nocheck
|
|
5
|
-
|
|
6
|
-
import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
|
|
7
|
-
import { Message, proto3 } from "@bufbuild/protobuf";
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @generated from enum bsync.Method
|
|
11
|
-
*/
|
|
12
|
-
export enum Method {
|
|
13
|
-
/**
|
|
14
|
-
* @generated from enum value: METHOD_UNSPECIFIED = 0;
|
|
15
|
-
*/
|
|
16
|
-
UNSPECIFIED = 0,
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @generated from enum value: METHOD_CREATE = 1;
|
|
20
|
-
*/
|
|
21
|
-
CREATE = 1,
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @generated from enum value: METHOD_UPDATE = 2;
|
|
25
|
-
*/
|
|
26
|
-
UPDATE = 2,
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* @generated from enum value: METHOD_DELETE = 3;
|
|
30
|
-
*/
|
|
31
|
-
DELETE = 3,
|
|
32
|
-
}
|
|
33
|
-
// Retrieve enum metadata with: proto3.getEnumType(Method)
|
|
34
|
-
proto3.util.setEnumType(Method, "bsync.Method", [
|
|
35
|
-
{ no: 0, name: "METHOD_UNSPECIFIED" },
|
|
36
|
-
{ no: 1, name: "METHOD_CREATE" },
|
|
37
|
-
{ no: 2, name: "METHOD_UPDATE" },
|
|
38
|
-
{ no: 3, name: "METHOD_DELETE" },
|
|
39
|
-
]);
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* @generated from message bsync.MuteOperation
|
|
43
|
-
*/
|
|
44
|
-
export class MuteOperation extends Message<MuteOperation> {
|
|
45
|
-
/**
|
|
46
|
-
* @generated from field: string id = 1;
|
|
47
|
-
*/
|
|
48
|
-
id = "";
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* @generated from field: bsync.MuteOperation.Type type = 2;
|
|
52
|
-
*/
|
|
53
|
-
type = MuteOperation_Type.UNSPECIFIED;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* @generated from field: string actor_did = 3;
|
|
57
|
-
*/
|
|
58
|
-
actorDid = "";
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* @generated from field: string subject = 4;
|
|
62
|
-
*/
|
|
63
|
-
subject = "";
|
|
64
|
-
|
|
65
|
-
constructor(data?: PartialMessage<MuteOperation>) {
|
|
66
|
-
super();
|
|
67
|
-
proto3.util.initPartial(data, this);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
static readonly runtime: typeof proto3 = proto3;
|
|
71
|
-
static readonly typeName = "bsync.MuteOperation";
|
|
72
|
-
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
73
|
-
{ no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
74
|
-
{ no: 2, name: "type", kind: "enum", T: proto3.getEnumType(MuteOperation_Type) },
|
|
75
|
-
{ no: 3, name: "actor_did", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
76
|
-
{ no: 4, name: "subject", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
77
|
-
]);
|
|
78
|
-
|
|
79
|
-
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MuteOperation {
|
|
80
|
-
return new MuteOperation().fromBinary(bytes, options);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MuteOperation {
|
|
84
|
-
return new MuteOperation().fromJson(jsonValue, options);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MuteOperation {
|
|
88
|
-
return new MuteOperation().fromJsonString(jsonString, options);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
static equals(a: MuteOperation | PlainMessage<MuteOperation> | undefined, b: MuteOperation | PlainMessage<MuteOperation> | undefined): boolean {
|
|
92
|
-
return proto3.util.equals(MuteOperation, a, b);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* @generated from enum bsync.MuteOperation.Type
|
|
98
|
-
*/
|
|
99
|
-
export enum MuteOperation_Type {
|
|
100
|
-
/**
|
|
101
|
-
* @generated from enum value: TYPE_UNSPECIFIED = 0;
|
|
102
|
-
*/
|
|
103
|
-
UNSPECIFIED = 0,
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* @generated from enum value: TYPE_ADD = 1;
|
|
107
|
-
*/
|
|
108
|
-
ADD = 1,
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* @generated from enum value: TYPE_REMOVE = 2;
|
|
112
|
-
*/
|
|
113
|
-
REMOVE = 2,
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* @generated from enum value: TYPE_CLEAR = 3;
|
|
117
|
-
*/
|
|
118
|
-
CLEAR = 3,
|
|
119
|
-
}
|
|
120
|
-
// Retrieve enum metadata with: proto3.getEnumType(MuteOperation_Type)
|
|
121
|
-
proto3.util.setEnumType(MuteOperation_Type, "bsync.MuteOperation.Type", [
|
|
122
|
-
{ no: 0, name: "TYPE_UNSPECIFIED" },
|
|
123
|
-
{ no: 1, name: "TYPE_ADD" },
|
|
124
|
-
{ no: 2, name: "TYPE_REMOVE" },
|
|
125
|
-
{ no: 3, name: "TYPE_CLEAR" },
|
|
126
|
-
]);
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* @generated from message bsync.AddMuteOperationRequest
|
|
130
|
-
*/
|
|
131
|
-
export class AddMuteOperationRequest extends Message<AddMuteOperationRequest> {
|
|
132
|
-
/**
|
|
133
|
-
* @generated from field: bsync.MuteOperation.Type type = 1;
|
|
134
|
-
*/
|
|
135
|
-
type = MuteOperation_Type.UNSPECIFIED;
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* @generated from field: string actor_did = 2;
|
|
139
|
-
*/
|
|
140
|
-
actorDid = "";
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* @generated from field: string subject = 3;
|
|
144
|
-
*/
|
|
145
|
-
subject = "";
|
|
146
|
-
|
|
147
|
-
constructor(data?: PartialMessage<AddMuteOperationRequest>) {
|
|
148
|
-
super();
|
|
149
|
-
proto3.util.initPartial(data, this);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
static readonly runtime: typeof proto3 = proto3;
|
|
153
|
-
static readonly typeName = "bsync.AddMuteOperationRequest";
|
|
154
|
-
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
155
|
-
{ no: 1, name: "type", kind: "enum", T: proto3.getEnumType(MuteOperation_Type) },
|
|
156
|
-
{ no: 2, name: "actor_did", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
157
|
-
{ no: 3, name: "subject", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
158
|
-
]);
|
|
159
|
-
|
|
160
|
-
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): AddMuteOperationRequest {
|
|
161
|
-
return new AddMuteOperationRequest().fromBinary(bytes, options);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): AddMuteOperationRequest {
|
|
165
|
-
return new AddMuteOperationRequest().fromJson(jsonValue, options);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): AddMuteOperationRequest {
|
|
169
|
-
return new AddMuteOperationRequest().fromJsonString(jsonString, options);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
static equals(a: AddMuteOperationRequest | PlainMessage<AddMuteOperationRequest> | undefined, b: AddMuteOperationRequest | PlainMessage<AddMuteOperationRequest> | undefined): boolean {
|
|
173
|
-
return proto3.util.equals(AddMuteOperationRequest, a, b);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* @generated from message bsync.AddMuteOperationResponse
|
|
179
|
-
*/
|
|
180
|
-
export class AddMuteOperationResponse extends Message<AddMuteOperationResponse> {
|
|
181
|
-
/**
|
|
182
|
-
* @generated from field: bsync.MuteOperation operation = 1;
|
|
183
|
-
*/
|
|
184
|
-
operation?: MuteOperation;
|
|
185
|
-
|
|
186
|
-
constructor(data?: PartialMessage<AddMuteOperationResponse>) {
|
|
187
|
-
super();
|
|
188
|
-
proto3.util.initPartial(data, this);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
static readonly runtime: typeof proto3 = proto3;
|
|
192
|
-
static readonly typeName = "bsync.AddMuteOperationResponse";
|
|
193
|
-
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
194
|
-
{ no: 1, name: "operation", kind: "message", T: MuteOperation },
|
|
195
|
-
]);
|
|
196
|
-
|
|
197
|
-
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): AddMuteOperationResponse {
|
|
198
|
-
return new AddMuteOperationResponse().fromBinary(bytes, options);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): AddMuteOperationResponse {
|
|
202
|
-
return new AddMuteOperationResponse().fromJson(jsonValue, options);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): AddMuteOperationResponse {
|
|
206
|
-
return new AddMuteOperationResponse().fromJsonString(jsonString, options);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
static equals(a: AddMuteOperationResponse | PlainMessage<AddMuteOperationResponse> | undefined, b: AddMuteOperationResponse | PlainMessage<AddMuteOperationResponse> | undefined): boolean {
|
|
210
|
-
return proto3.util.equals(AddMuteOperationResponse, a, b);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* @generated from message bsync.ScanMuteOperationsRequest
|
|
216
|
-
*/
|
|
217
|
-
export class ScanMuteOperationsRequest extends Message<ScanMuteOperationsRequest> {
|
|
218
|
-
/**
|
|
219
|
-
* @generated from field: string cursor = 1;
|
|
220
|
-
*/
|
|
221
|
-
cursor = "";
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* @generated from field: int32 limit = 2;
|
|
225
|
-
*/
|
|
226
|
-
limit = 0;
|
|
227
|
-
|
|
228
|
-
constructor(data?: PartialMessage<ScanMuteOperationsRequest>) {
|
|
229
|
-
super();
|
|
230
|
-
proto3.util.initPartial(data, this);
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
static readonly runtime: typeof proto3 = proto3;
|
|
234
|
-
static readonly typeName = "bsync.ScanMuteOperationsRequest";
|
|
235
|
-
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
236
|
-
{ no: 1, name: "cursor", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
237
|
-
{ no: 2, name: "limit", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
|
|
238
|
-
]);
|
|
239
|
-
|
|
240
|
-
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ScanMuteOperationsRequest {
|
|
241
|
-
return new ScanMuteOperationsRequest().fromBinary(bytes, options);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ScanMuteOperationsRequest {
|
|
245
|
-
return new ScanMuteOperationsRequest().fromJson(jsonValue, options);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ScanMuteOperationsRequest {
|
|
249
|
-
return new ScanMuteOperationsRequest().fromJsonString(jsonString, options);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
static equals(a: ScanMuteOperationsRequest | PlainMessage<ScanMuteOperationsRequest> | undefined, b: ScanMuteOperationsRequest | PlainMessage<ScanMuteOperationsRequest> | undefined): boolean {
|
|
253
|
-
return proto3.util.equals(ScanMuteOperationsRequest, a, b);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* @generated from message bsync.ScanMuteOperationsResponse
|
|
259
|
-
*/
|
|
260
|
-
export class ScanMuteOperationsResponse extends Message<ScanMuteOperationsResponse> {
|
|
261
|
-
/**
|
|
262
|
-
* @generated from field: repeated bsync.MuteOperation operations = 1;
|
|
263
|
-
*/
|
|
264
|
-
operations: MuteOperation[] = [];
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* @generated from field: string cursor = 2;
|
|
268
|
-
*/
|
|
269
|
-
cursor = "";
|
|
270
|
-
|
|
271
|
-
constructor(data?: PartialMessage<ScanMuteOperationsResponse>) {
|
|
272
|
-
super();
|
|
273
|
-
proto3.util.initPartial(data, this);
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
static readonly runtime: typeof proto3 = proto3;
|
|
277
|
-
static readonly typeName = "bsync.ScanMuteOperationsResponse";
|
|
278
|
-
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
279
|
-
{ no: 1, name: "operations", kind: "message", T: MuteOperation, repeated: true },
|
|
280
|
-
{ no: 2, name: "cursor", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
281
|
-
]);
|
|
282
|
-
|
|
283
|
-
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ScanMuteOperationsResponse {
|
|
284
|
-
return new ScanMuteOperationsResponse().fromBinary(bytes, options);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ScanMuteOperationsResponse {
|
|
288
|
-
return new ScanMuteOperationsResponse().fromJson(jsonValue, options);
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ScanMuteOperationsResponse {
|
|
292
|
-
return new ScanMuteOperationsResponse().fromJsonString(jsonString, options);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
static equals(a: ScanMuteOperationsResponse | PlainMessage<ScanMuteOperationsResponse> | undefined, b: ScanMuteOperationsResponse | PlainMessage<ScanMuteOperationsResponse> | undefined): boolean {
|
|
296
|
-
return proto3.util.equals(ScanMuteOperationsResponse, a, b);
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
/**
|
|
301
|
-
* @generated from message bsync.NotifOperation
|
|
302
|
-
*/
|
|
303
|
-
export class NotifOperation extends Message<NotifOperation> {
|
|
304
|
-
/**
|
|
305
|
-
* @generated from field: string id = 1;
|
|
306
|
-
*/
|
|
307
|
-
id = "";
|
|
308
|
-
|
|
309
|
-
/**
|
|
310
|
-
* @generated from field: string actor_did = 2;
|
|
311
|
-
*/
|
|
312
|
-
actorDid = "";
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* @generated from field: optional bool priority = 3;
|
|
316
|
-
*/
|
|
317
|
-
priority?: boolean;
|
|
318
|
-
|
|
319
|
-
constructor(data?: PartialMessage<NotifOperation>) {
|
|
320
|
-
super();
|
|
321
|
-
proto3.util.initPartial(data, this);
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
static readonly runtime: typeof proto3 = proto3;
|
|
325
|
-
static readonly typeName = "bsync.NotifOperation";
|
|
326
|
-
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
327
|
-
{ no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
328
|
-
{ no: 2, name: "actor_did", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
329
|
-
{ no: 3, name: "priority", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
|
|
330
|
-
]);
|
|
331
|
-
|
|
332
|
-
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): NotifOperation {
|
|
333
|
-
return new NotifOperation().fromBinary(bytes, options);
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): NotifOperation {
|
|
337
|
-
return new NotifOperation().fromJson(jsonValue, options);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): NotifOperation {
|
|
341
|
-
return new NotifOperation().fromJsonString(jsonString, options);
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
static equals(a: NotifOperation | PlainMessage<NotifOperation> | undefined, b: NotifOperation | PlainMessage<NotifOperation> | undefined): boolean {
|
|
345
|
-
return proto3.util.equals(NotifOperation, a, b);
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* @generated from message bsync.AddNotifOperationRequest
|
|
351
|
-
*/
|
|
352
|
-
export class AddNotifOperationRequest extends Message<AddNotifOperationRequest> {
|
|
353
|
-
/**
|
|
354
|
-
* @generated from field: string actor_did = 1;
|
|
355
|
-
*/
|
|
356
|
-
actorDid = "";
|
|
357
|
-
|
|
358
|
-
/**
|
|
359
|
-
* @generated from field: optional bool priority = 2;
|
|
360
|
-
*/
|
|
361
|
-
priority?: boolean;
|
|
362
|
-
|
|
363
|
-
constructor(data?: PartialMessage<AddNotifOperationRequest>) {
|
|
364
|
-
super();
|
|
365
|
-
proto3.util.initPartial(data, this);
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
static readonly runtime: typeof proto3 = proto3;
|
|
369
|
-
static readonly typeName = "bsync.AddNotifOperationRequest";
|
|
370
|
-
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
371
|
-
{ no: 1, name: "actor_did", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
372
|
-
{ no: 2, name: "priority", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
|
|
373
|
-
]);
|
|
374
|
-
|
|
375
|
-
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): AddNotifOperationRequest {
|
|
376
|
-
return new AddNotifOperationRequest().fromBinary(bytes, options);
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): AddNotifOperationRequest {
|
|
380
|
-
return new AddNotifOperationRequest().fromJson(jsonValue, options);
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): AddNotifOperationRequest {
|
|
384
|
-
return new AddNotifOperationRequest().fromJsonString(jsonString, options);
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
static equals(a: AddNotifOperationRequest | PlainMessage<AddNotifOperationRequest> | undefined, b: AddNotifOperationRequest | PlainMessage<AddNotifOperationRequest> | undefined): boolean {
|
|
388
|
-
return proto3.util.equals(AddNotifOperationRequest, a, b);
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
/**
|
|
393
|
-
* @generated from message bsync.AddNotifOperationResponse
|
|
394
|
-
*/
|
|
395
|
-
export class AddNotifOperationResponse extends Message<AddNotifOperationResponse> {
|
|
396
|
-
/**
|
|
397
|
-
* @generated from field: bsync.NotifOperation operation = 1;
|
|
398
|
-
*/
|
|
399
|
-
operation?: NotifOperation;
|
|
400
|
-
|
|
401
|
-
constructor(data?: PartialMessage<AddNotifOperationResponse>) {
|
|
402
|
-
super();
|
|
403
|
-
proto3.util.initPartial(data, this);
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
static readonly runtime: typeof proto3 = proto3;
|
|
407
|
-
static readonly typeName = "bsync.AddNotifOperationResponse";
|
|
408
|
-
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
409
|
-
{ no: 1, name: "operation", kind: "message", T: NotifOperation },
|
|
410
|
-
]);
|
|
411
|
-
|
|
412
|
-
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): AddNotifOperationResponse {
|
|
413
|
-
return new AddNotifOperationResponse().fromBinary(bytes, options);
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): AddNotifOperationResponse {
|
|
417
|
-
return new AddNotifOperationResponse().fromJson(jsonValue, options);
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): AddNotifOperationResponse {
|
|
421
|
-
return new AddNotifOperationResponse().fromJsonString(jsonString, options);
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
static equals(a: AddNotifOperationResponse | PlainMessage<AddNotifOperationResponse> | undefined, b: AddNotifOperationResponse | PlainMessage<AddNotifOperationResponse> | undefined): boolean {
|
|
425
|
-
return proto3.util.equals(AddNotifOperationResponse, a, b);
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
/**
|
|
430
|
-
* @generated from message bsync.ScanNotifOperationsRequest
|
|
431
|
-
*/
|
|
432
|
-
export class ScanNotifOperationsRequest extends Message<ScanNotifOperationsRequest> {
|
|
433
|
-
/**
|
|
434
|
-
* @generated from field: string cursor = 1;
|
|
435
|
-
*/
|
|
436
|
-
cursor = "";
|
|
437
|
-
|
|
438
|
-
/**
|
|
439
|
-
* @generated from field: int32 limit = 2;
|
|
440
|
-
*/
|
|
441
|
-
limit = 0;
|
|
442
|
-
|
|
443
|
-
constructor(data?: PartialMessage<ScanNotifOperationsRequest>) {
|
|
444
|
-
super();
|
|
445
|
-
proto3.util.initPartial(data, this);
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
static readonly runtime: typeof proto3 = proto3;
|
|
449
|
-
static readonly typeName = "bsync.ScanNotifOperationsRequest";
|
|
450
|
-
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
451
|
-
{ no: 1, name: "cursor", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
452
|
-
{ no: 2, name: "limit", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
|
|
453
|
-
]);
|
|
454
|
-
|
|
455
|
-
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ScanNotifOperationsRequest {
|
|
456
|
-
return new ScanNotifOperationsRequest().fromBinary(bytes, options);
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ScanNotifOperationsRequest {
|
|
460
|
-
return new ScanNotifOperationsRequest().fromJson(jsonValue, options);
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ScanNotifOperationsRequest {
|
|
464
|
-
return new ScanNotifOperationsRequest().fromJsonString(jsonString, options);
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
static equals(a: ScanNotifOperationsRequest | PlainMessage<ScanNotifOperationsRequest> | undefined, b: ScanNotifOperationsRequest | PlainMessage<ScanNotifOperationsRequest> | undefined): boolean {
|
|
468
|
-
return proto3.util.equals(ScanNotifOperationsRequest, a, b);
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
/**
|
|
473
|
-
* @generated from message bsync.ScanNotifOperationsResponse
|
|
474
|
-
*/
|
|
475
|
-
export class ScanNotifOperationsResponse extends Message<ScanNotifOperationsResponse> {
|
|
476
|
-
/**
|
|
477
|
-
* @generated from field: repeated bsync.NotifOperation operations = 1;
|
|
478
|
-
*/
|
|
479
|
-
operations: NotifOperation[] = [];
|
|
480
|
-
|
|
481
|
-
/**
|
|
482
|
-
* @generated from field: string cursor = 2;
|
|
483
|
-
*/
|
|
484
|
-
cursor = "";
|
|
485
|
-
|
|
486
|
-
constructor(data?: PartialMessage<ScanNotifOperationsResponse>) {
|
|
487
|
-
super();
|
|
488
|
-
proto3.util.initPartial(data, this);
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
static readonly runtime: typeof proto3 = proto3;
|
|
492
|
-
static readonly typeName = "bsync.ScanNotifOperationsResponse";
|
|
493
|
-
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
494
|
-
{ no: 1, name: "operations", kind: "message", T: NotifOperation, repeated: true },
|
|
495
|
-
{ no: 2, name: "cursor", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
496
|
-
]);
|
|
497
|
-
|
|
498
|
-
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ScanNotifOperationsResponse {
|
|
499
|
-
return new ScanNotifOperationsResponse().fromBinary(bytes, options);
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ScanNotifOperationsResponse {
|
|
503
|
-
return new ScanNotifOperationsResponse().fromJson(jsonValue, options);
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ScanNotifOperationsResponse {
|
|
507
|
-
return new ScanNotifOperationsResponse().fromJsonString(jsonString, options);
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
static equals(a: ScanNotifOperationsResponse | PlainMessage<ScanNotifOperationsResponse> | undefined, b: ScanNotifOperationsResponse | PlainMessage<ScanNotifOperationsResponse> | undefined): boolean {
|
|
511
|
-
return proto3.util.equals(ScanNotifOperationsResponse, a, b);
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
/**
|
|
516
|
-
* @generated from message bsync.Operation
|
|
517
|
-
*/
|
|
518
|
-
export class Operation extends Message<Operation> {
|
|
519
|
-
/**
|
|
520
|
-
* @generated from field: string id = 1;
|
|
521
|
-
*/
|
|
522
|
-
id = "";
|
|
523
|
-
|
|
524
|
-
/**
|
|
525
|
-
* @generated from field: string actor_did = 2;
|
|
526
|
-
*/
|
|
527
|
-
actorDid = "";
|
|
528
|
-
|
|
529
|
-
/**
|
|
530
|
-
* @generated from field: string namespace = 3;
|
|
531
|
-
*/
|
|
532
|
-
namespace = "";
|
|
533
|
-
|
|
534
|
-
/**
|
|
535
|
-
* @generated from field: string key = 4;
|
|
536
|
-
*/
|
|
537
|
-
key = "";
|
|
538
|
-
|
|
539
|
-
/**
|
|
540
|
-
* @generated from field: bsync.Method method = 5;
|
|
541
|
-
*/
|
|
542
|
-
method = Method.UNSPECIFIED;
|
|
543
|
-
|
|
544
|
-
/**
|
|
545
|
-
* @generated from field: bytes payload = 6;
|
|
546
|
-
*/
|
|
547
|
-
payload = new Uint8Array(0);
|
|
548
|
-
|
|
549
|
-
constructor(data?: PartialMessage<Operation>) {
|
|
550
|
-
super();
|
|
551
|
-
proto3.util.initPartial(data, this);
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
static readonly runtime: typeof proto3 = proto3;
|
|
555
|
-
static readonly typeName = "bsync.Operation";
|
|
556
|
-
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
557
|
-
{ no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
558
|
-
{ no: 2, name: "actor_did", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
559
|
-
{ no: 3, name: "namespace", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
560
|
-
{ no: 4, name: "key", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
561
|
-
{ no: 5, name: "method", kind: "enum", T: proto3.getEnumType(Method) },
|
|
562
|
-
{ no: 6, name: "payload", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
|
|
563
|
-
]);
|
|
564
|
-
|
|
565
|
-
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Operation {
|
|
566
|
-
return new Operation().fromBinary(bytes, options);
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Operation {
|
|
570
|
-
return new Operation().fromJson(jsonValue, options);
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Operation {
|
|
574
|
-
return new Operation().fromJsonString(jsonString, options);
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
static equals(a: Operation | PlainMessage<Operation> | undefined, b: Operation | PlainMessage<Operation> | undefined): boolean {
|
|
578
|
-
return proto3.util.equals(Operation, a, b);
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
/**
|
|
583
|
-
* @generated from message bsync.PutOperationRequest
|
|
584
|
-
*/
|
|
585
|
-
export class PutOperationRequest extends Message<PutOperationRequest> {
|
|
586
|
-
/**
|
|
587
|
-
* @generated from field: string actor_did = 1;
|
|
588
|
-
*/
|
|
589
|
-
actorDid = "";
|
|
590
|
-
|
|
591
|
-
/**
|
|
592
|
-
* @generated from field: string namespace = 2;
|
|
593
|
-
*/
|
|
594
|
-
namespace = "";
|
|
595
|
-
|
|
596
|
-
/**
|
|
597
|
-
* @generated from field: string key = 3;
|
|
598
|
-
*/
|
|
599
|
-
key = "";
|
|
600
|
-
|
|
601
|
-
/**
|
|
602
|
-
* @generated from field: bsync.Method method = 4;
|
|
603
|
-
*/
|
|
604
|
-
method = Method.UNSPECIFIED;
|
|
605
|
-
|
|
606
|
-
/**
|
|
607
|
-
* @generated from field: bytes payload = 5;
|
|
608
|
-
*/
|
|
609
|
-
payload = new Uint8Array(0);
|
|
610
|
-
|
|
611
|
-
constructor(data?: PartialMessage<PutOperationRequest>) {
|
|
612
|
-
super();
|
|
613
|
-
proto3.util.initPartial(data, this);
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
static readonly runtime: typeof proto3 = proto3;
|
|
617
|
-
static readonly typeName = "bsync.PutOperationRequest";
|
|
618
|
-
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
619
|
-
{ no: 1, name: "actor_did", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
620
|
-
{ no: 2, name: "namespace", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
621
|
-
{ no: 3, name: "key", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
622
|
-
{ no: 4, name: "method", kind: "enum", T: proto3.getEnumType(Method) },
|
|
623
|
-
{ no: 5, name: "payload", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
|
|
624
|
-
]);
|
|
625
|
-
|
|
626
|
-
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): PutOperationRequest {
|
|
627
|
-
return new PutOperationRequest().fromBinary(bytes, options);
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): PutOperationRequest {
|
|
631
|
-
return new PutOperationRequest().fromJson(jsonValue, options);
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): PutOperationRequest {
|
|
635
|
-
return new PutOperationRequest().fromJsonString(jsonString, options);
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
static equals(a: PutOperationRequest | PlainMessage<PutOperationRequest> | undefined, b: PutOperationRequest | PlainMessage<PutOperationRequest> | undefined): boolean {
|
|
639
|
-
return proto3.util.equals(PutOperationRequest, a, b);
|
|
640
|
-
}
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
/**
|
|
644
|
-
* @generated from message bsync.PutOperationResponse
|
|
645
|
-
*/
|
|
646
|
-
export class PutOperationResponse extends Message<PutOperationResponse> {
|
|
647
|
-
/**
|
|
648
|
-
* @generated from field: bsync.Operation operation = 1;
|
|
649
|
-
*/
|
|
650
|
-
operation?: Operation;
|
|
651
|
-
|
|
652
|
-
constructor(data?: PartialMessage<PutOperationResponse>) {
|
|
653
|
-
super();
|
|
654
|
-
proto3.util.initPartial(data, this);
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
static readonly runtime: typeof proto3 = proto3;
|
|
658
|
-
static readonly typeName = "bsync.PutOperationResponse";
|
|
659
|
-
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
660
|
-
{ no: 1, name: "operation", kind: "message", T: Operation },
|
|
661
|
-
]);
|
|
662
|
-
|
|
663
|
-
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): PutOperationResponse {
|
|
664
|
-
return new PutOperationResponse().fromBinary(bytes, options);
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): PutOperationResponse {
|
|
668
|
-
return new PutOperationResponse().fromJson(jsonValue, options);
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): PutOperationResponse {
|
|
672
|
-
return new PutOperationResponse().fromJsonString(jsonString, options);
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
static equals(a: PutOperationResponse | PlainMessage<PutOperationResponse> | undefined, b: PutOperationResponse | PlainMessage<PutOperationResponse> | undefined): boolean {
|
|
676
|
-
return proto3.util.equals(PutOperationResponse, a, b);
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
/**
|
|
681
|
-
* @generated from message bsync.ScanOperationsRequest
|
|
682
|
-
*/
|
|
683
|
-
export class ScanOperationsRequest extends Message<ScanOperationsRequest> {
|
|
684
|
-
/**
|
|
685
|
-
* @generated from field: string cursor = 1;
|
|
686
|
-
*/
|
|
687
|
-
cursor = "";
|
|
688
|
-
|
|
689
|
-
/**
|
|
690
|
-
* @generated from field: int32 limit = 2;
|
|
691
|
-
*/
|
|
692
|
-
limit = 0;
|
|
693
|
-
|
|
694
|
-
constructor(data?: PartialMessage<ScanOperationsRequest>) {
|
|
695
|
-
super();
|
|
696
|
-
proto3.util.initPartial(data, this);
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
static readonly runtime: typeof proto3 = proto3;
|
|
700
|
-
static readonly typeName = "bsync.ScanOperationsRequest";
|
|
701
|
-
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
702
|
-
{ no: 1, name: "cursor", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
703
|
-
{ no: 2, name: "limit", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
|
|
704
|
-
]);
|
|
705
|
-
|
|
706
|
-
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ScanOperationsRequest {
|
|
707
|
-
return new ScanOperationsRequest().fromBinary(bytes, options);
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ScanOperationsRequest {
|
|
711
|
-
return new ScanOperationsRequest().fromJson(jsonValue, options);
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ScanOperationsRequest {
|
|
715
|
-
return new ScanOperationsRequest().fromJsonString(jsonString, options);
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
static equals(a: ScanOperationsRequest | PlainMessage<ScanOperationsRequest> | undefined, b: ScanOperationsRequest | PlainMessage<ScanOperationsRequest> | undefined): boolean {
|
|
719
|
-
return proto3.util.equals(ScanOperationsRequest, a, b);
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
/**
|
|
724
|
-
* @generated from message bsync.ScanOperationsResponse
|
|
725
|
-
*/
|
|
726
|
-
export class ScanOperationsResponse extends Message<ScanOperationsResponse> {
|
|
727
|
-
/**
|
|
728
|
-
* @generated from field: repeated bsync.Operation operations = 1;
|
|
729
|
-
*/
|
|
730
|
-
operations: Operation[] = [];
|
|
731
|
-
|
|
732
|
-
/**
|
|
733
|
-
* @generated from field: string cursor = 2;
|
|
734
|
-
*/
|
|
735
|
-
cursor = "";
|
|
736
|
-
|
|
737
|
-
constructor(data?: PartialMessage<ScanOperationsResponse>) {
|
|
738
|
-
super();
|
|
739
|
-
proto3.util.initPartial(data, this);
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
static readonly runtime: typeof proto3 = proto3;
|
|
743
|
-
static readonly typeName = "bsync.ScanOperationsResponse";
|
|
744
|
-
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
745
|
-
{ no: 1, name: "operations", kind: "message", T: Operation, repeated: true },
|
|
746
|
-
{ no: 2, name: "cursor", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
747
|
-
]);
|
|
748
|
-
|
|
749
|
-
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ScanOperationsResponse {
|
|
750
|
-
return new ScanOperationsResponse().fromBinary(bytes, options);
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ScanOperationsResponse {
|
|
754
|
-
return new ScanOperationsResponse().fromJson(jsonValue, options);
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ScanOperationsResponse {
|
|
758
|
-
return new ScanOperationsResponse().fromJsonString(jsonString, options);
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
static equals(a: ScanOperationsResponse | PlainMessage<ScanOperationsResponse> | undefined, b: ScanOperationsResponse | PlainMessage<ScanOperationsResponse> | undefined): boolean {
|
|
762
|
-
return proto3.util.equals(ScanOperationsResponse, a, b);
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
/**
|
|
767
|
-
* @generated from message bsync.DeleteOperationsByActorAndNamespaceRequest
|
|
768
|
-
*/
|
|
769
|
-
export class DeleteOperationsByActorAndNamespaceRequest extends Message<DeleteOperationsByActorAndNamespaceRequest> {
|
|
770
|
-
/**
|
|
771
|
-
* @generated from field: string actor_did = 1;
|
|
772
|
-
*/
|
|
773
|
-
actorDid = "";
|
|
774
|
-
|
|
775
|
-
/**
|
|
776
|
-
* @generated from field: string namespace = 2;
|
|
777
|
-
*/
|
|
778
|
-
namespace = "";
|
|
779
|
-
|
|
780
|
-
constructor(data?: PartialMessage<DeleteOperationsByActorAndNamespaceRequest>) {
|
|
781
|
-
super();
|
|
782
|
-
proto3.util.initPartial(data, this);
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
static readonly runtime: typeof proto3 = proto3;
|
|
786
|
-
static readonly typeName = "bsync.DeleteOperationsByActorAndNamespaceRequest";
|
|
787
|
-
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
788
|
-
{ no: 1, name: "actor_did", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
789
|
-
{ no: 2, name: "namespace", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
790
|
-
]);
|
|
791
|
-
|
|
792
|
-
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): DeleteOperationsByActorAndNamespaceRequest {
|
|
793
|
-
return new DeleteOperationsByActorAndNamespaceRequest().fromBinary(bytes, options);
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): DeleteOperationsByActorAndNamespaceRequest {
|
|
797
|
-
return new DeleteOperationsByActorAndNamespaceRequest().fromJson(jsonValue, options);
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): DeleteOperationsByActorAndNamespaceRequest {
|
|
801
|
-
return new DeleteOperationsByActorAndNamespaceRequest().fromJsonString(jsonString, options);
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
static equals(a: DeleteOperationsByActorAndNamespaceRequest | PlainMessage<DeleteOperationsByActorAndNamespaceRequest> | undefined, b: DeleteOperationsByActorAndNamespaceRequest | PlainMessage<DeleteOperationsByActorAndNamespaceRequest> | undefined): boolean {
|
|
805
|
-
return proto3.util.equals(DeleteOperationsByActorAndNamespaceRequest, a, b);
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
|
|
809
|
-
/**
|
|
810
|
-
* @generated from message bsync.DeleteOperationsByActorAndNamespaceResponse
|
|
811
|
-
*/
|
|
812
|
-
export class DeleteOperationsByActorAndNamespaceResponse extends Message<DeleteOperationsByActorAndNamespaceResponse> {
|
|
813
|
-
/**
|
|
814
|
-
* @generated from field: int32 deleted_count = 1;
|
|
815
|
-
*/
|
|
816
|
-
deletedCount = 0;
|
|
817
|
-
|
|
818
|
-
constructor(data?: PartialMessage<DeleteOperationsByActorAndNamespaceResponse>) {
|
|
819
|
-
super();
|
|
820
|
-
proto3.util.initPartial(data, this);
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
static readonly runtime: typeof proto3 = proto3;
|
|
824
|
-
static readonly typeName = "bsync.DeleteOperationsByActorAndNamespaceResponse";
|
|
825
|
-
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
826
|
-
{ no: 1, name: "deleted_count", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
|
|
827
|
-
]);
|
|
828
|
-
|
|
829
|
-
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): DeleteOperationsByActorAndNamespaceResponse {
|
|
830
|
-
return new DeleteOperationsByActorAndNamespaceResponse().fromBinary(bytes, options);
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): DeleteOperationsByActorAndNamespaceResponse {
|
|
834
|
-
return new DeleteOperationsByActorAndNamespaceResponse().fromJson(jsonValue, options);
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): DeleteOperationsByActorAndNamespaceResponse {
|
|
838
|
-
return new DeleteOperationsByActorAndNamespaceResponse().fromJsonString(jsonString, options);
|
|
839
|
-
}
|
|
840
|
-
|
|
841
|
-
static equals(a: DeleteOperationsByActorAndNamespaceResponse | PlainMessage<DeleteOperationsByActorAndNamespaceResponse> | undefined, b: DeleteOperationsByActorAndNamespaceResponse | PlainMessage<DeleteOperationsByActorAndNamespaceResponse> | undefined): boolean {
|
|
842
|
-
return proto3.util.equals(DeleteOperationsByActorAndNamespaceResponse, a, b);
|
|
843
|
-
}
|
|
844
|
-
}
|
|
845
|
-
|
|
846
|
-
/**
|
|
847
|
-
* Ping
|
|
848
|
-
*
|
|
849
|
-
* @generated from message bsync.PingRequest
|
|
850
|
-
*/
|
|
851
|
-
export class PingRequest extends Message<PingRequest> {
|
|
852
|
-
constructor(data?: PartialMessage<PingRequest>) {
|
|
853
|
-
super();
|
|
854
|
-
proto3.util.initPartial(data, this);
|
|
855
|
-
}
|
|
856
|
-
|
|
857
|
-
static readonly runtime: typeof proto3 = proto3;
|
|
858
|
-
static readonly typeName = "bsync.PingRequest";
|
|
859
|
-
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
860
|
-
]);
|
|
861
|
-
|
|
862
|
-
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): PingRequest {
|
|
863
|
-
return new PingRequest().fromBinary(bytes, options);
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): PingRequest {
|
|
867
|
-
return new PingRequest().fromJson(jsonValue, options);
|
|
868
|
-
}
|
|
869
|
-
|
|
870
|
-
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): PingRequest {
|
|
871
|
-
return new PingRequest().fromJsonString(jsonString, options);
|
|
872
|
-
}
|
|
873
|
-
|
|
874
|
-
static equals(a: PingRequest | PlainMessage<PingRequest> | undefined, b: PingRequest | PlainMessage<PingRequest> | undefined): boolean {
|
|
875
|
-
return proto3.util.equals(PingRequest, a, b);
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
/**
|
|
880
|
-
* @generated from message bsync.PingResponse
|
|
881
|
-
*/
|
|
882
|
-
export class PingResponse extends Message<PingResponse> {
|
|
883
|
-
constructor(data?: PartialMessage<PingResponse>) {
|
|
884
|
-
super();
|
|
885
|
-
proto3.util.initPartial(data, this);
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
static readonly runtime: typeof proto3 = proto3;
|
|
889
|
-
static readonly typeName = "bsync.PingResponse";
|
|
890
|
-
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
891
|
-
]);
|
|
892
|
-
|
|
893
|
-
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): PingResponse {
|
|
894
|
-
return new PingResponse().fromBinary(bytes, options);
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): PingResponse {
|
|
898
|
-
return new PingResponse().fromJson(jsonValue, options);
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): PingResponse {
|
|
902
|
-
return new PingResponse().fromJsonString(jsonString, options);
|
|
903
|
-
}
|
|
904
|
-
|
|
905
|
-
static equals(a: PingResponse | PlainMessage<PingResponse> | undefined, b: PingResponse | PlainMessage<PingResponse> | undefined): boolean {
|
|
906
|
-
return proto3.util.equals(PingResponse, a, b);
|
|
907
|
-
}
|
|
908
|
-
}
|
|
909
|
-
|