Suite of AT Protocol TypeScript libraries built on web standards
20
fork

Configure Feed

Select the types of activity you want to include in your feed.

seperate server specific common utils

+22 -9
+5 -2
common/deno.json
··· 1 1 { 2 2 "name": "@atp/common", 3 - "version": "0.1.0-alpha.5", 4 - "exports": "./mod.ts", 3 + "version": "0.1.0-alpha.6", 4 + "exports": { 5 + ".": "./mod.ts", 6 + "./server": "./server.ts" 7 + }, 5 8 "license": "MIT", 6 9 "imports": { 7 10 "@ipld/dag-cbor": "npm:@ipld/dag-cbor@^9.2.5",
+3 -4
common/mod.ts
··· 2 2 * # AT Protocol Common Utilities 3 3 * 4 4 * Shared TypeScript code for other @atp/* packages. 5 - * This package is oriented towards writing servers. 5 + * This module is web-compatible. 6 + * 7 + * For server-only utilities (env, fs, logger), use "@atp/common/server". 6 8 * 7 9 * @module 8 10 */ 9 11 export * as check from "./check.ts"; 10 12 export * as util from "./util.ts"; 11 13 12 - export * from "./env.ts"; 13 - export * from "./fs.ts"; 14 14 export * from "./ipld.ts"; 15 15 export * from "./ipld-multi.ts"; 16 16 export * from "./obfuscate.ts"; ··· 19 19 export * from "./types.ts"; 20 20 export * from "./tid.ts"; 21 21 export * from "./strings.ts"; 22 - export * from "./logger.ts"; 23 22 export * from "./dates.ts"; 24 23 export * from "./util.ts"; 25 24 export * from "./retry.ts";
+11
common/server.ts
··· 1 + /** 2 + * # AT Protocol Common Utilities (Server) 3 + * 4 + * Server-only utilities that require Deno/Node.js runtime. 5 + * Includes: env, fs, logger. 6 + * 7 + * @module 8 + */ 9 + export * from "./env.ts"; 10 + export * from "./fs.ts"; 11 + export * from "./logger.ts";
+3 -3
sync/firehose/index.ts
··· 250 250 if (!parsed) { 251 251 continue; 252 252 } 253 - this.opts.runner.trackEvent(parsed.did, parsed.seq, async () => { 253 + await this.opts.runner.trackEvent(parsed.did, parsed.seq, async () => { 254 254 const parsed = await this.parseEvt(evt); 255 255 for (const write of parsed) { 256 256 try { 257 - this.opts.handleEvent(write); 257 + await this.opts.handleEvent(write); 258 258 } catch (err) { 259 259 this.opts.onError(new FirehoseHandlerError(err, write)); 260 260 } ··· 314 314 const parsed = await this.parseEvt(evt); 315 315 for (const write of parsed) { 316 316 try { 317 - this.opts.handleEvent(write); 317 + await this.opts.handleEvent(write); 318 318 } catch (err) { 319 319 this.opts.onError(new FirehoseHandlerError(err, write)); 320 320 }