@atproto/dev-env 0.5.41 → 0.5.42
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 +20 -0
- package/bin.js +0 -2
- package/dist/env.js +3 -3
- package/dist/env.js.map +1 -1
- package/dist/feed-gen.d.ts.map +1 -1
- package/dist/feed-gen.js +2 -3
- package/dist/feed-gen.js.map +1 -1
- package/dist/introspect.d.ts.map +1 -1
- package/dist/introspect.js +2 -3
- package/dist/introspect.js.map +1 -1
- package/package.json +13 -13
- package/src/env.ts +3 -3
- package/src/feed-gen.ts +3 -4
- package/src/introspect.ts +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atproto/dev-env
|
|
2
2
|
|
|
3
|
+
## 0.5.42
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#5301](https://github.com/bluesky-social/atproto/pull/5301) [`8c07338`](https://github.com/bluesky-social/atproto/commit/8c07338232aa69427aa65322a555f70e0211d6d7) Thanks [@43081j](https://github.com/43081j)! - Switch from destructured default imports to named imports of CommonJS dependencies.
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`5a222b0`](https://github.com/bluesky-social/atproto/commit/5a222b05da5f9c0d32d41fb1c4437ea188aa2c32), [`6a3d607`](https://github.com/bluesky-social/atproto/commit/6a3d6073cb66c527b5b109242049c85c36b9658c), [`ee4a0cf`](https://github.com/bluesky-social/atproto/commit/ee4a0cf0ebb3e078a014bef882720f46aca5cb89), [`2cbbb5d`](https://github.com/bluesky-social/atproto/commit/2cbbb5d16ccb1597e0391aa674349f795b404b8b), [`d12f6ac`](https://github.com/bluesky-social/atproto/commit/d12f6ac6e2cb2590446bf9f2051287bac058c092), [`29dcbc0`](https://github.com/bluesky-social/atproto/commit/29dcbc091ca72cb9dda7a2cea846f3eb4bfcef6c), [`a8186e7`](https://github.com/bluesky-social/atproto/commit/a8186e7cdb5ea3d8a88c2e9283d742de1bc0bba6), [`d12f6ac`](https://github.com/bluesky-social/atproto/commit/d12f6ac6e2cb2590446bf9f2051287bac058c092), [`8c07338`](https://github.com/bluesky-social/atproto/commit/8c07338232aa69427aa65322a555f70e0211d6d7), [`d12f6ac`](https://github.com/bluesky-social/atproto/commit/d12f6ac6e2cb2590446bf9f2051287bac058c092)]:
|
|
10
|
+
- @atproto/xrpc-server@0.12.0
|
|
11
|
+
- @atproto/lex@0.3.3
|
|
12
|
+
- @atproto/syntax@0.7.3
|
|
13
|
+
- @atproto/bsky@0.0.270
|
|
14
|
+
- @atproto/api@0.20.37
|
|
15
|
+
- @atproto/ozone@0.2.24
|
|
16
|
+
- @atproto/sync@0.4.0
|
|
17
|
+
- @atproto/bsync@0.0.38
|
|
18
|
+
- @atproto/pds@0.5.24
|
|
19
|
+
- @atproto/common-web@0.5.8
|
|
20
|
+
- @atproto/lexicon@0.7.10
|
|
21
|
+
- @atproto/identity@0.5.8
|
|
22
|
+
|
|
3
23
|
## 0.5.41
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/bin.js
CHANGED
package/dist/env.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// NOTE: this file should be imported first, particularly before `@atproto/common` (for logging), to ensure that environment variables are respected in library code
|
|
2
|
-
import
|
|
2
|
+
import { config } from 'dotenv';
|
|
3
3
|
const env = process.env.ENV;
|
|
4
4
|
if (env) {
|
|
5
|
-
|
|
5
|
+
config({ path: `./.${env}.env` });
|
|
6
6
|
}
|
|
7
7
|
else {
|
|
8
|
-
|
|
8
|
+
config();
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=env.js.map
|
package/dist/env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA,oKAAoK;AACpK,OAAO,MAAM,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA,oKAAoK;AACpK,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAA;AAC3B,IAAI,GAAG,EAAE,CAAC;IACR,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAA;AACnC,CAAC;KAAM,CAAC;IACN,MAAM,EAAE,CAAA;AACV,CAAC","sourcesContent":["// NOTE: this file should be imported first, particularly before `@atproto/common` (for logging), to ensure that environment variables are respected in library code\nimport { config } from 'dotenv'\n\nconst env = process.env.ENV\nif (env) {\n config({ path: `./.${env}.env` })\n} else {\n config()\n}\n"]}
|
package/dist/feed-gen.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feed-gen.d.ts","sourceRoot":"","sources":["../src/feed-gen.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"feed-gen.d.ts","sourceRoot":"","sources":["../src/feed-gen.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAKjC,OAAO,EAAE,KAAK,eAAe,EAAO,MAAM,cAAc,CAAA;AAIxD,qBAAa,WAAW;IASb,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,IAAI,CAAC,MAAM;IACnB,GAAG,EAAE,MAAM;IAVpB,OAAO,CAAC,UAAU,CAAgB;IAClC,OAAO,CAAC,iBAAiB,CAAC,CAAe;IAEzC,IAAI,SAAS,YAEZ;IAED,YACS,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,GAAG,EAAE,MAAM,EAGnB;IAED,OAAa,MAAM,CACjB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GACrC,OAAO,CAAC,WAAW,CAAC,CA4BtB;IAED,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAErB;IAEK,CAAC,MAAM,CAAC,YAAY,CAAC,kBAE1B;CACF"}
|
package/dist/feed-gen.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import events from 'node:events';
|
|
2
2
|
import * as plc from '@did-plc/lib';
|
|
3
3
|
import getPort from 'get-port';
|
|
4
|
-
|
|
5
|
-
import httpTerminator from 'http-terminator';
|
|
4
|
+
import { createHttpTerminator } from 'http-terminator';
|
|
6
5
|
import { Secp256k1Keypair } from '@atproto/crypto';
|
|
7
6
|
import { app } from '@atproto/pds';
|
|
8
7
|
import { InvalidRequestError, createServer } from '@atproto/xrpc-server';
|
|
@@ -14,7 +13,7 @@ export class TestFeedGen {
|
|
|
14
13
|
this.port = port;
|
|
15
14
|
this.server = server;
|
|
16
15
|
this.did = did;
|
|
17
|
-
this.terminator =
|
|
16
|
+
this.terminator = createHttpTerminator({ server });
|
|
18
17
|
}
|
|
19
18
|
static async create(plcUrl, feeds) {
|
|
20
19
|
const port = await getPort();
|
package/dist/feed-gen.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feed-gen.js","sourceRoot":"","sources":["../src/feed-gen.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAEhC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,OAAO,MAAM,UAAU,CAAA;AAC9B,
|
|
1
|
+
{"version":3,"file":"feed-gen.js","sourceRoot":"","sources":["../src/feed-gen.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAEhC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,OAAO,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAuB,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAA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AC,aAAa,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;IACtC,OAAO,GAAgB,CAAA;AACzB,CAAC,CAAA","sourcesContent":["import events from 'node:events'\nimport type http from 'node:http'\nimport * as plc from '@did-plc/lib'\nimport getPort from 'get-port'\nimport { type HttpTerminator, createHttpTerminator } from 'http-terminator'\nimport { Secp256k1Keypair } from '@atproto/crypto'\nimport { type SkeletonHandler, app } from '@atproto/pds'\nimport type { AtUriString, DidString } from '@atproto/syntax'\nimport { InvalidRequestError, createServer } from '@atproto/xrpc-server'\n\nexport class TestFeedGen {\n private terminator: HttpTerminator\n private terminatorPromise?: Promise<void>\n\n get destroyed() {\n return this.terminatorPromise != null\n }\n\n constructor(\n public port: number,\n public server: http.Server,\n public did: string,\n ) {\n this.terminator = createHttpTerminator({ server })\n }\n\n static async create(\n plcUrl: string,\n feeds: Record<string, SkeletonHandler>,\n ): Promise<TestFeedGen> {\n const port = await getPort()\n const did = await createFgDid(plcUrl, port)\n const xrpcServer = createServer()\n\n xrpcServer.add(app.bsky.feed.getFeedSkeleton, async (args) => {\n const handler = feeds[args.params.feed]\n if (!handler) {\n throw new InvalidRequestError('unknown feed', 'UnknownFeed')\n }\n return handler(args)\n })\n\n xrpcServer.add(app.bsky.feed.describeFeedGenerator, async () => {\n return {\n encoding: 'application/json' as const,\n body: {\n did: did as DidString,\n feeds: (Object.keys(feeds) as AtUriString[]).map((uri) => ({\n uri,\n })),\n },\n }\n })\n\n const httpServer = xrpcServer.listen(port)\n await events.once(httpServer, 'listening')\n return new TestFeedGen(port, httpServer, did)\n }\n\n close(): Promise<void> {\n return (this.terminatorPromise ??= this.terminator.terminate())\n }\n\n async [Symbol.asyncDispose]() {\n await this.close()\n }\n}\n\nconst createFgDid = async (\n plcUrl: string,\n port: number,\n): Promise<DidString> => {\n const keypair = await Secp256k1Keypair.create()\n const plcClient = new plc.Client(plcUrl)\n const op = await plc.signOperation(\n {\n type: 'plc_operation',\n verificationMethods: {\n atproto: keypair.did(),\n },\n rotationKeys: [keypair.did()],\n alsoKnownAs: [],\n services: {\n bsky_fg: {\n type: 'BskyFeedGenerator',\n endpoint: `http://localhost:${port}`,\n },\n },\n prev: null,\n },\n keypair,\n )\n const did = await plc.didForCreateOp(op)\n await plcClient.sendOperation(did, op)\n return did as DidString\n}\n"]}
|
package/dist/introspect.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"introspect.d.ts","sourceRoot":"","sources":["../src/introspect.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"introspect.d.ts","sourceRoot":"","sources":["../src/introspect.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAGjC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAEvC,qBAAa,gBAAgB;IAGlB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,IAAI,CAAC,MAAM;IAH5B,OAAO,CAAC,UAAU,CAAgB;IAClC,YACS,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,IAAI,CAAC,MAAM,EAG3B;IAED,OAAa,KAAK,CAChB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,SAAS,6BA+BjB;IAEK,KAAK,kBAEV;CACF"}
|
package/dist/introspect.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import events from 'node:events';
|
|
2
2
|
import express from 'express';
|
|
3
|
-
|
|
4
|
-
import httpTerminator from 'http-terminator';
|
|
3
|
+
import { createHttpTerminator } from 'http-terminator';
|
|
5
4
|
export class IntrospectServer {
|
|
6
5
|
constructor(port, server) {
|
|
7
6
|
this.port = port;
|
|
8
7
|
this.server = server;
|
|
9
|
-
this.terminator =
|
|
8
|
+
this.terminator = createHttpTerminator({ server });
|
|
10
9
|
}
|
|
11
10
|
static async start(port, plc, pds, bsync, bsky, ozone) {
|
|
12
11
|
const app = express();
|
package/dist/introspect.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"introspect.js","sourceRoot":"","sources":["../src/introspect.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAEhC,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,
|
|
1
|
+
{"version":3,"file":"introspect.js","sourceRoot":"","sources":["../src/introspect.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAEhC,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAuB,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAO3E,MAAM,OAAO,gBAAgB;IAE3B,YACS,IAAY,EACZ,MAAmB;oBADnB,IAAI;sBACJ,MAAM;QAEb,IAAI,CAAC,UAAU,GAAG,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAA;IACpD,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,KAAK,CAChB,IAAY,EACZ,GAAY,EACZ,GAAY,EACZ,KAAgB,EAChB,IAAc,EACd,KAAgB;QAEhB,MAAM,GAAG,GAAG,OAAO,EAAE,CAAA;QACrB,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;YACzB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACnB,GAAG,EAAE;oBACH,GAAG,EAAE,GAAG,CAAC,GAAG;iBACb;gBACD,GAAG,EAAE;oBACH,GAAG,EAAE,GAAG,CAAC,GAAG;oBACZ,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG;iBAC7B;gBACD,KAAK,EAAE;oBACL,GAAG,EAAE,KAAK,CAAC,GAAG;iBACf;gBACD,IAAI,EAAE;oBACJ,GAAG,EAAE,IAAI,CAAC,GAAG;oBACb,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS;iBAC5B;gBACD,KAAK,EAAE;oBACL,GAAG,EAAE,KAAK,CAAC,GAAG;oBACd,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG;iBAC/B;gBACD,EAAE,EAAE;oBACF,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,WAAW;iBAClC;aACF,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QACF,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QAC/B,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;QACtC,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IAC3C,CAAC;IAED,KAAK,CAAC,KAAK;QACT,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAA;IACnC,CAAC;CACF","sourcesContent":["import events from 'node:events'\nimport type http from 'node:http'\nimport express from 'express'\nimport { type HttpTerminator, createHttpTerminator } from 'http-terminator'\nimport type { TestBsky } from './bsky.js'\nimport type { TestBsync } from './bsync.js'\nimport type { TestOzone } from './ozone.js'\nimport type { TestPds } from './pds.js'\nimport type { TestPlc } from './plc.js'\n\nexport class IntrospectServer {\n private terminator: HttpTerminator\n constructor(\n public port: number,\n public server: http.Server,\n ) {\n this.terminator = createHttpTerminator({ server })\n }\n\n static async start(\n port: number,\n plc: TestPlc,\n pds: TestPds,\n bsync: TestBsync,\n bsky: TestBsky,\n ozone: TestOzone,\n ) {\n const app = express()\n app.get('/', (_req, res) => {\n res.status(200).send({\n plc: {\n url: plc.url,\n },\n pds: {\n url: pds.url,\n did: pds.ctx.cfg.service.did,\n },\n bsync: {\n url: bsync.url,\n },\n bsky: {\n url: bsky.url,\n did: bsky.ctx.cfg.serverDid,\n },\n ozone: {\n url: ozone.url,\n did: ozone.ctx.cfg.service.did,\n },\n db: {\n url: ozone.ctx.cfg.db.postgresUrl,\n },\n })\n })\n const server = app.listen(port)\n await events.once(server, 'listening')\n return new IntrospectServer(port, server)\n }\n\n async close() {\n await this.terminator.terminate()\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/dev-env",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.42",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Local development environment helper for atproto development",
|
|
6
6
|
"keywords": [
|
|
@@ -40,19 +40,19 @@
|
|
|
40
40
|
"multiformats": "^13.0.0",
|
|
41
41
|
"uint8arrays": "^5.0.0",
|
|
42
42
|
"undici": "^8.5.0",
|
|
43
|
-
"@atproto/api": "^0.20.
|
|
44
|
-
"@atproto/bsky": "^0.0.
|
|
45
|
-
"@atproto/bsync": "^0.0.
|
|
46
|
-
"@atproto/common-web": "^0.5.
|
|
47
|
-
"@atproto/identity": "^0.5.7",
|
|
48
|
-
"@atproto/lexicon": "^0.7.9",
|
|
43
|
+
"@atproto/api": "^0.20.37",
|
|
44
|
+
"@atproto/bsky": "^0.0.270",
|
|
45
|
+
"@atproto/bsync": "^0.0.38",
|
|
46
|
+
"@atproto/common-web": "^0.5.8",
|
|
49
47
|
"@atproto/crypto": "^0.5.4",
|
|
50
|
-
"@atproto/
|
|
51
|
-
"@atproto/
|
|
52
|
-
"@atproto/lex": "^0.3.
|
|
53
|
-
"@atproto/
|
|
54
|
-
"@atproto/
|
|
55
|
-
"@atproto/
|
|
48
|
+
"@atproto/identity": "^0.5.8",
|
|
49
|
+
"@atproto/lexicon": "^0.7.10",
|
|
50
|
+
"@atproto/lex": "^0.3.3",
|
|
51
|
+
"@atproto/pds": "^0.5.24",
|
|
52
|
+
"@atproto/ozone": "^0.2.24",
|
|
53
|
+
"@atproto/sync": "^0.4.0",
|
|
54
|
+
"@atproto/syntax": "^0.7.3",
|
|
55
|
+
"@atproto/xrpc-server": "^0.12.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@types/express": "^4.17.13"
|
package/src/env.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// NOTE: this file should be imported first, particularly before `@atproto/common` (for logging), to ensure that environment variables are respected in library code
|
|
2
|
-
import
|
|
2
|
+
import { config } from 'dotenv'
|
|
3
3
|
|
|
4
4
|
const env = process.env.ENV
|
|
5
5
|
if (env) {
|
|
6
|
-
|
|
6
|
+
config({ path: `./.${env}.env` })
|
|
7
7
|
} else {
|
|
8
|
-
|
|
8
|
+
config()
|
|
9
9
|
}
|
package/src/feed-gen.ts
CHANGED
|
@@ -2,15 +2,14 @@ import events from 'node:events'
|
|
|
2
2
|
import type http from 'node:http'
|
|
3
3
|
import * as plc from '@did-plc/lib'
|
|
4
4
|
import getPort from 'get-port'
|
|
5
|
-
|
|
6
|
-
import httpTerminator from 'http-terminator'
|
|
5
|
+
import { type HttpTerminator, createHttpTerminator } from 'http-terminator'
|
|
7
6
|
import { Secp256k1Keypair } from '@atproto/crypto'
|
|
8
7
|
import { type SkeletonHandler, app } from '@atproto/pds'
|
|
9
8
|
import type { AtUriString, DidString } from '@atproto/syntax'
|
|
10
9
|
import { InvalidRequestError, createServer } from '@atproto/xrpc-server'
|
|
11
10
|
|
|
12
11
|
export class TestFeedGen {
|
|
13
|
-
private terminator:
|
|
12
|
+
private terminator: HttpTerminator
|
|
14
13
|
private terminatorPromise?: Promise<void>
|
|
15
14
|
|
|
16
15
|
get destroyed() {
|
|
@@ -22,7 +21,7 @@ export class TestFeedGen {
|
|
|
22
21
|
public server: http.Server,
|
|
23
22
|
public did: string,
|
|
24
23
|
) {
|
|
25
|
-
this.terminator =
|
|
24
|
+
this.terminator = createHttpTerminator({ server })
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
static async create(
|
package/src/introspect.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import events from 'node:events'
|
|
2
2
|
import type http from 'node:http'
|
|
3
3
|
import express from 'express'
|
|
4
|
-
|
|
5
|
-
import httpTerminator from 'http-terminator'
|
|
4
|
+
import { type HttpTerminator, createHttpTerminator } from 'http-terminator'
|
|
6
5
|
import type { TestBsky } from './bsky.js'
|
|
7
6
|
import type { TestBsync } from './bsync.js'
|
|
8
7
|
import type { TestOzone } from './ozone.js'
|
|
@@ -10,12 +9,12 @@ import type { TestPds } from './pds.js'
|
|
|
10
9
|
import type { TestPlc } from './plc.js'
|
|
11
10
|
|
|
12
11
|
export class IntrospectServer {
|
|
13
|
-
private terminator:
|
|
12
|
+
private terminator: HttpTerminator
|
|
14
13
|
constructor(
|
|
15
14
|
public port: number,
|
|
16
15
|
public server: http.Server,
|
|
17
16
|
) {
|
|
18
|
-
this.terminator =
|
|
17
|
+
this.terminator = createHttpTerminator({ server })
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
static async start(
|