@atproto/dev-env 0.6.0 → 0.6.1

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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atproto/dev-env
2
2
 
3
+ ## 0.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#5379](https://github.com/bluesky-social/atproto/pull/5379) [`6dac4dd`](https://github.com/bluesky-social/atproto/commit/6dac4dd01fa766c069b0eeab9dc55d3ae6297075) Thanks [@ds-boyce](https://github.com/ds-boyce)! - Expose canonical OP thread numbering on feed items.
8
+
9
+ - Updated dependencies [[`c26b463`](https://github.com/bluesky-social/atproto/commit/c26b463a36124deb14b8d56ad1810eeddaa129cc), [`54edd67`](https://github.com/bluesky-social/atproto/commit/54edd671ebf3fd66ea88822fdb58c2a96e6140e5), [`b31485e`](https://github.com/bluesky-social/atproto/commit/b31485ec5012f543fd60304df9a1684fac4e3dea), [`898c469`](https://github.com/bluesky-social/atproto/commit/898c469cf568b941f38f9c3371997a513ac05cfa), [`05305a7`](https://github.com/bluesky-social/atproto/commit/05305a7a18fc830262a23850dd659e8e98db0149), [`68aaad8`](https://github.com/bluesky-social/atproto/commit/68aaad8ce22b3e58e768980ccb5e3556a6d71b23), [`898c469`](https://github.com/bluesky-social/atproto/commit/898c469cf568b941f38f9c3371997a513ac05cfa), [`c7f39c5`](https://github.com/bluesky-social/atproto/commit/c7f39c527758ffd5b21b896fac494ecf7e69aa37), [`7f87e4a`](https://github.com/bluesky-social/atproto/commit/7f87e4a761ec6f3e0c25da25d0bc44b198b4bf80), [`898c469`](https://github.com/bluesky-social/atproto/commit/898c469cf568b941f38f9c3371997a513ac05cfa), [`6dac4dd`](https://github.com/bluesky-social/atproto/commit/6dac4dd01fa766c069b0eeab9dc55d3ae6297075), [`898c469`](https://github.com/bluesky-social/atproto/commit/898c469cf568b941f38f9c3371997a513ac05cfa)]:
10
+ - @atproto/api@0.20.40
11
+ - @atproto/bsky@0.0.274
12
+ - @atproto/pds@0.5.28
13
+ - @atproto/bsync@0.0.41
14
+ - @atproto/ozone@0.2.28
15
+ - @atproto/sync@0.4.4
16
+ - @atproto/xrpc-server@0.12.4
17
+ - @atproto/lex@0.3.6
18
+
3
19
  ## 0.6.0
4
20
 
5
21
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAGtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAGlC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAMlD,qBAAa,WAAY,SAAQ,oBAAoB;IAE1C,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,OAAO;IACZ,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,SAAS;IAChB,UAAU,CAAC,EAAE,gBAAgB;IANtC,YACS,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,SAAS,EAChB,UAAU,CAAC,EAAE,gBAAgB,YAAA,EAGrC;IAED,OAAa,MAAM,CACjB,MAAM,GAAE,OAAO,CAAC,gBAAgB,CAAM,GACrC,OAAO,CAAC,WAAW,CAAC,CA8HtB;IAEK,uBAAuB,CAAC,OAAO,SAAO,iBAmB3C;IAEK,UAAU,CAAC,OAAO,CAAC,EA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AAO,CAAC,WAAW,CAAC,CA+HtB;IAEK,uBAAuB,CAAC,OAAO,SAAO,iBAmB3C;IAEK,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,iBAShC;IAEK,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM;;OAS1D;IAEK,YAAY,CAAC,EACjB,QAAyB,EACzB,QAAyB,GAC1B,EAAE;QACD,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;KAClB;;OASA;IAEK,KAAK,kBAcV;IAEK,CAAC,MAAM,CAAC,YAAY,CAAC,kBAE1B;CACF"}
package/dist/network.js CHANGED
@@ -51,6 +51,7 @@ export class TestNetwork extends TestNetworkNoAppView {
51
51
  const bsync = await TestBsync.create({
52
52
  apiKeys: [bsyncApiKey],
53
53
  dbUrl: dbPostgresUrl,
54
+ dbSchema: `bsync_${dbPostgresSchema}`,
54
55
  });
55
56
  const bsky = await TestBsky.create({
56
57
  port: bskyPort,
@@ -1 +1 @@
1
- {"version":3,"file":"network.js","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,KAAK,WAAW,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,OAAO,MAAM,eAAe,CAAA;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,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zB,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;IACpB,CAAC;CACF","sourcesContent":["import assert from 'node:assert'\nimport * as uint8arrays from 'uint8arrays'\nimport { allFulfilled, wait } from '@atproto/common-web'\nimport { createServiceJwt } from '@atproto/xrpc-server'\nimport { TestBsky } from './bsky.js'\nimport { TestBsync } from './bsync.js'\nimport { EXAMPLE_LABELER } from './const.js'\nimport getPort from './get-port.js'\nimport { IntrospectServer } from './introspect.js'\nimport { TestNetworkNoAppView } from './network-no-appview.js'\nimport { TestOzone } from './ozone.js'\nimport { TestPds } from './pds.js'\nimport { TestPlc } from './plc.js'\nimport { LexiconAuthorityProfile } from './service-profile-lexicon.js'\nimport { OzoneServiceProfile } from './service-profile-ozone.js'\nimport type { TestServerParams } from './types.js'\nimport { mockNetworkUtilities } from './util.js'\n\nconst ADMIN_USERNAME = 'admin'\nconst ADMIN_PASSWORD = 'admin-pass'\n\nexport class TestNetwork extends TestNetworkNoAppView {\n constructor(\n public plc: TestPlc,\n public pds: TestPds,\n public bsync: TestBsync,\n public bsky: TestBsky,\n public ozone: TestOzone,\n public introspect?: IntrospectServer,\n ) {\n super(plc, pds)\n }\n\n static async create(\n params: Partial<TestServerParams> = {},\n ): Promise<TestNetwork> {\n const redisHost = process.env.REDIS_HOST\n const dbPostgresUrl = params.dbPostgresUrl || process.env.DB_POSTGRES_URL\n assert(dbPostgresUrl, 'Missing postgres url for tests')\n assert(redisHost, 'Missing redis host for tests')\n const dbPostgresSchema =\n params.dbPostgresSchema || process.env.DB_POSTGRES_SCHEMA\n\n const plc = await TestPlc.create(params.plc ?? {})\n\n const bskyPort = params.bsky?.port ?? (await getPort())\n const pdsPort = params.pds?.port ?? (await getPort())\n const ozonePort = params.ozone?.port ?? (await getPort())\n\n const thirdPartyPds = await TestPds.create({\n didPlcUrl: plc.url,\n ...params.pds,\n inviteRequired: false,\n port: await getPort(),\n })\n\n const ozoneUrl = `http://localhost:${ozonePort}`\n\n // @TODO (?) rework the ServiceProfile to live on a separate PDS instead of\n // requiring to migrate to the main PDS\n const ozoneServiceProfile = await OzoneServiceProfile.create(\n thirdPartyPds,\n ozoneUrl,\n )\n const lexiconAuthorityProfile =\n await LexiconAuthorityProfile.create(thirdPartyPds)\n\n const bsyncApiKey = 'bsync-api-key'\n const bsync = await TestBsync.create({\n apiKeys: [bsyncApiKey],\n dbUrl: dbPostgresUrl,\n })\n\n const bsky = await TestBsky.create({\n port: bskyPort,\n plcUrl: plc.url,\n pdsPort,\n bsyncApiKey,\n bsyncUrl: bsync.url,\n rolodexUrl: process.env.BSKY_ROLODEX_URL,\n rolodexIgnoreBadTls: true,\n repoProvider: `ws://localhost:${pdsPort}`,\n dbPostgresSchema: `appview_${dbPostgresSchema}`,\n dbPostgresUrl,\n redisHost,\n modServiceDid: ozoneServiceProfile.did,\n labelsFromIssuerDids: [ozoneServiceProfile.did, EXAMPLE_LABELER],\n // Using a static private key results in a static DID, which is useful for e2e tests with the social-app repo.\n privateKey:\n '3f916c70dc69e4c5e83877f013325b11ecac31742e6a42f5c4fb240d0703d9d5=',\n ...params.bsky,\n })\n\n const pds = await TestPds.create({\n port: pdsPort,\n didPlcUrl: plc.url,\n bskyAppViewUrl: bsky.url,\n bskyAppViewDid: bsky.ctx.cfg.serverDid,\n modServiceUrl: ozoneUrl,\n modServiceDid: ozoneServiceProfile.did,\n lexiconDidAuthority: lexiconAuthorityProfile.did,\n ...params.pds,\n })\n\n // mock before any events start flowing from pds so that we don't miss e.g. any handle resolutions.\n mockNetworkUtilities(pds, bsky)\n\n const ozone = await TestOzone.create({\n port: ozonePort,\n plcUrl: plc.url,\n signingKey: ozoneServiceProfile.key,\n serverDid: ozoneServiceProfile.did,\n dbPostgresSchema: `ozone_${dbPostgresSchema || 'db'}`,\n dbPostgresUrl,\n appviewUrl: bsky.url,\n appviewDid: bsky.ctx.cfg.serverDid,\n appviewPushEvents: true,\n pdsUrl: pds.url,\n pdsDid: pds.ctx.cfg.service.did,\n verifierDid: ozoneServiceProfile.did,\n verifierUrl: pds.url,\n verifierPassword: 'temp',\n ...params.ozone,\n })\n\n await ozoneServiceProfile.migrateTo(pds)\n await ozoneServiceProfile.createRecords()\n\n await lexiconAuthorityProfile.migrateTo(pds)\n await lexiconAuthorityProfile.createRecords()\n\n await ozone.addAdminDid(ozoneServiceProfile.did)\n await ozone.createPolicies()\n\n await thirdPartyPds.processAll()\n await pds.processAll()\n await ozone.processAll()\n await bsky.sub.processAll()\n await bsky.bsyncSub.processAll(await bsync.getStreamHeads())\n await thirdPartyPds.close()\n\n // Weird but if we do this before pds.processAll() somehow appview loses this user and tests in different parts fail because appview doesn't return this user in various contexts anymore\n const ozoneVerifierPassword =\n await ozoneServiceProfile.createAppPasswordForVerification()\n if (ozone.daemon.ctx.cfg.verifier) {\n ozone.daemon.ctx.cfg.verifier.password = ozoneVerifierPassword\n }\n\n let introspect: IntrospectServer | undefined = undefined\n if (params.introspect?.port) {\n introspect = await IntrospectServer.start(\n params.introspect.port,\n plc,\n pds,\n bsync,\n bsky,\n ozone,\n )\n }\n\n return new TestNetwork(plc, pds, bsync, bsky, ozone, introspect)\n }\n\n async processFullSubscription(timeout = 5000) {\n const sub = this.bsky.sub\n // If the subscription is not running, there is no point in\n // waiting for it to process events\n if (!sub.running) return\n const start = Date.now()\n const lastSeq = await this.pds.ctx.sequencer.curr()\n if (!lastSeq) return\n while (Date.now() - start < timeout) {\n await sub.processAll()\n const runnerCursor = await sub.getCursor()\n // if subscription claims to be done, ensure we are at the most recent cursor from PDS, else wait to process again\n // (the subscription may claim to be finished before the PDS has even emitted it's event)\n if (runnerCursor && runnerCursor >= lastSeq) {\n return\n }\n await wait(5)\n }\n throw new Error(`Sequence was not processed within ${timeout}ms`)\n }\n\n async processAll(timeout?: number) {\n await this.pds.processAll()\n await this.ozone.processAll()\n await this.bsky.sub.processAll()\n await this.bsky.bsyncSub.processAll(\n await this.bsync.getStreamHeads(),\n timeout,\n )\n await this.processFullSubscription(timeout)\n }\n\n async serviceHeaders(did: string, lxm: string, aud?: string) {\n const keypair = await this.pds.ctx.actorStore.keypair(did)\n const jwt = await createServiceJwt({\n iss: did,\n aud: aud ?? this.bsky.ctx.cfg.serverDid,\n lxm,\n keypair,\n })\n return { authorization: `Bearer ${jwt}` }\n }\n\n async adminHeaders({\n username = ADMIN_USERNAME,\n password = ADMIN_PASSWORD,\n }: {\n username?: string\n password?: string\n }) {\n return {\n authorization:\n 'Basic ' +\n uint8arrays.toString(\n uint8arrays.fromString(`${username}:${password}`, 'utf8'),\n 'base64pad',\n ),\n }\n }\n\n async close() {\n try {\n await this.processAll()\n } finally {\n await allFulfilled([\n ...this.feedGens.map(async (fg) => fg.close()),\n this.ozone.close(),\n this.bsky.close(),\n this.bsync.close(),\n this.pds.close(),\n this.plc.close(),\n this.introspect?.close(),\n ])\n }\n }\n\n async [Symbol.asyncDispose]() {\n await this.close()\n }\n}\n"]}
1
+ {"version":3,"file":"network.js","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,KAAK,WAAW,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,OAAO,MAAM,eAAe,CAAA;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,U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import * as uint8arrays from 'uint8arrays'\nimport { allFulfilled, wait } from '@atproto/common-web'\nimport { createServiceJwt } from '@atproto/xrpc-server'\nimport { TestBsky } from './bsky.js'\nimport { TestBsync } from './bsync.js'\nimport { EXAMPLE_LABELER } from './const.js'\nimport getPort from './get-port.js'\nimport { IntrospectServer } from './introspect.js'\nimport { TestNetworkNoAppView } from './network-no-appview.js'\nimport { TestOzone } from './ozone.js'\nimport { TestPds } from './pds.js'\nimport { TestPlc } from './plc.js'\nimport { LexiconAuthorityProfile } from './service-profile-lexicon.js'\nimport { OzoneServiceProfile } from './service-profile-ozone.js'\nimport type { TestServerParams } from './types.js'\nimport { mockNetworkUtilities } from './util.js'\n\nconst ADMIN_USERNAME = 'admin'\nconst ADMIN_PASSWORD = 'admin-pass'\n\nexport class TestNetwork extends TestNetworkNoAppView {\n constructor(\n public plc: TestPlc,\n public pds: TestPds,\n public bsync: TestBsync,\n public bsky: TestBsky,\n public ozone: TestOzone,\n public introspect?: IntrospectServer,\n ) {\n super(plc, pds)\n }\n\n static async create(\n params: Partial<TestServerParams> = {},\n ): Promise<TestNetwork> {\n const redisHost = process.env.REDIS_HOST\n const dbPostgresUrl = params.dbPostgresUrl || process.env.DB_POSTGRES_URL\n assert(dbPostgresUrl, 'Missing postgres url for tests')\n assert(redisHost, 'Missing redis host for tests')\n const dbPostgresSchema =\n params.dbPostgresSchema || process.env.DB_POSTGRES_SCHEMA\n\n const plc = await TestPlc.create(params.plc ?? {})\n\n const bskyPort = params.bsky?.port ?? (await getPort())\n const pdsPort = params.pds?.port ?? (await getPort())\n const ozonePort = params.ozone?.port ?? (await getPort())\n\n const thirdPartyPds = await TestPds.create({\n didPlcUrl: plc.url,\n ...params.pds,\n inviteRequired: false,\n port: await getPort(),\n })\n\n const ozoneUrl = `http://localhost:${ozonePort}`\n\n // @TODO (?) rework the ServiceProfile to live on a separate PDS instead of\n // requiring to migrate to the main PDS\n const ozoneServiceProfile = await OzoneServiceProfile.create(\n thirdPartyPds,\n ozoneUrl,\n )\n const lexiconAuthorityProfile =\n await LexiconAuthorityProfile.create(thirdPartyPds)\n\n const bsyncApiKey = 'bsync-api-key'\n const bsync = await TestBsync.create({\n apiKeys: [bsyncApiKey],\n dbUrl: dbPostgresUrl,\n dbSchema: `bsync_${dbPostgresSchema}`,\n })\n\n const bsky = await TestBsky.create({\n port: bskyPort,\n plcUrl: plc.url,\n pdsPort,\n bsyncApiKey,\n bsyncUrl: bsync.url,\n rolodexUrl: process.env.BSKY_ROLODEX_URL,\n rolodexIgnoreBadTls: true,\n repoProvider: `ws://localhost:${pdsPort}`,\n dbPostgresSchema: `appview_${dbPostgresSchema}`,\n dbPostgresUrl,\n redisHost,\n modServiceDid: ozoneServiceProfile.did,\n labelsFromIssuerDids: [ozoneServiceProfile.did, EXAMPLE_LABELER],\n // Using a static private key results in a static DID, which is useful for e2e tests with the social-app repo.\n privateKey:\n '3f916c70dc69e4c5e83877f013325b11ecac31742e6a42f5c4fb240d0703d9d5=',\n ...params.bsky,\n })\n\n const pds = await TestPds.create({\n port: pdsPort,\n didPlcUrl: plc.url,\n bskyAppViewUrl: bsky.url,\n bskyAppViewDid: bsky.ctx.cfg.serverDid,\n modServiceUrl: ozoneUrl,\n modServiceDid: ozoneServiceProfile.did,\n lexiconDidAuthority: lexiconAuthorityProfile.did,\n ...params.pds,\n })\n\n // mock before any events start flowing from pds so that we don't miss e.g. any handle resolutions.\n mockNetworkUtilities(pds, bsky)\n\n const ozone = await TestOzone.create({\n port: ozonePort,\n plcUrl: plc.url,\n signingKey: ozoneServiceProfile.key,\n serverDid: ozoneServiceProfile.did,\n dbPostgresSchema: `ozone_${dbPostgresSchema || 'db'}`,\n dbPostgresUrl,\n appviewUrl: bsky.url,\n appviewDid: bsky.ctx.cfg.serverDid,\n appviewPushEvents: true,\n pdsUrl: pds.url,\n pdsDid: pds.ctx.cfg.service.did,\n verifierDid: ozoneServiceProfile.did,\n verifierUrl: pds.url,\n verifierPassword: 'temp',\n ...params.ozone,\n })\n\n await ozoneServiceProfile.migrateTo(pds)\n await ozoneServiceProfile.createRecords()\n\n await lexiconAuthorityProfile.migrateTo(pds)\n await lexiconAuthorityProfile.createRecords()\n\n await ozone.addAdminDid(ozoneServiceProfile.did)\n await ozone.createPolicies()\n\n await thirdPartyPds.processAll()\n await pds.processAll()\n await ozone.processAll()\n await bsky.sub.processAll()\n await bsky.bsyncSub.processAll(await bsync.getStreamHeads())\n await thirdPartyPds.close()\n\n // Weird but if we do this before pds.processAll() somehow appview loses this user and tests in different parts fail because appview doesn't return this user in various contexts anymore\n const ozoneVerifierPassword =\n await ozoneServiceProfile.createAppPasswordForVerification()\n if (ozone.daemon.ctx.cfg.verifier) {\n ozone.daemon.ctx.cfg.verifier.password = ozoneVerifierPassword\n }\n\n let introspect: IntrospectServer | undefined = undefined\n if (params.introspect?.port) {\n introspect = await IntrospectServer.start(\n params.introspect.port,\n plc,\n pds,\n bsync,\n bsky,\n ozone,\n )\n }\n\n return new TestNetwork(plc, pds, bsync, bsky, ozone, introspect)\n }\n\n async processFullSubscription(timeout = 5000) {\n const sub = this.bsky.sub\n // If the subscription is not running, there is no point in\n // waiting for it to process events\n if (!sub.running) return\n const start = Date.now()\n const lastSeq = await this.pds.ctx.sequencer.curr()\n if (!lastSeq) return\n while (Date.now() - start < timeout) {\n await sub.processAll()\n const runnerCursor = await sub.getCursor()\n // if subscription claims to be done, ensure we are at the most recent cursor from PDS, else wait to process again\n // (the subscription may claim to be finished before the PDS has even emitted it's event)\n if (runnerCursor && runnerCursor >= lastSeq) {\n return\n }\n await wait(5)\n }\n throw new Error(`Sequence was not processed within ${timeout}ms`)\n }\n\n async processAll(timeout?: number) {\n await this.pds.processAll()\n await this.ozone.processAll()\n await this.bsky.sub.processAll()\n await this.bsky.bsyncSub.processAll(\n await this.bsync.getStreamHeads(),\n timeout,\n )\n await this.processFullSubscription(timeout)\n }\n\n async serviceHeaders(did: string, lxm: string, aud?: string) {\n const keypair = await this.pds.ctx.actorStore.keypair(did)\n const jwt = await createServiceJwt({\n iss: did,\n aud: aud ?? this.bsky.ctx.cfg.serverDid,\n lxm,\n keypair,\n })\n return { authorization: `Bearer ${jwt}` }\n }\n\n async adminHeaders({\n username = ADMIN_USERNAME,\n password = ADMIN_PASSWORD,\n }: {\n username?: string\n password?: string\n }) {\n return {\n authorization:\n 'Basic ' +\n uint8arrays.toString(\n uint8arrays.fromString(`${username}:${password}`, 'utf8'),\n 'base64pad',\n ),\n }\n }\n\n async close() {\n try {\n await this.processAll()\n } finally {\n await allFulfilled([\n ...this.feedGens.map(async (fg) => fg.close()),\n this.ozone.close(),\n this.bsky.close(),\n this.bsync.close(),\n this.pds.close(),\n this.plc.close(),\n this.introspect?.close(),\n ])\n }\n }\n\n async [Symbol.asyncDispose]() {\n await this.close()\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/dev-env",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "license": "MIT",
5
5
  "description": "Local development environment helper for atproto development",
6
6
  "keywords": [
@@ -33,26 +33,26 @@
33
33
  "dependencies": {
34
34
  "@did-plc/lib": "^0.0.1",
35
35
  "@did-plc/server": "^0.0.1",
36
- "dotenv": "^16.0.3",
36
+ "dotenv": "^17.4.2",
37
37
  "express": "^4.18.2",
38
38
  "get-port": "^5.1.1",
39
39
  "http-terminator": "^3.2.0",
40
40
  "multiformats": "^13.0.0",
41
41
  "uint8arrays": "^5.0.0",
42
42
  "undici": "^8.5.0",
43
- "@atproto/bsky": "^0.0.273",
44
- "@atproto/api": "^0.20.39",
45
- "@atproto/bsync": "^0.0.40",
43
+ "@atproto/bsync": "^0.0.41",
46
44
  "@atproto/common-web": "^0.5.9",
45
+ "@atproto/bsky": "^0.0.274",
46
+ "@atproto/api": "^0.20.40",
47
+ "@atproto/crypto": "^0.5.4",
47
48
  "@atproto/identity": "^0.5.9",
48
- "@atproto/lex": "^0.3.5",
49
+ "@atproto/lex": "^0.3.6",
49
50
  "@atproto/lexicon": "^0.7.11",
50
- "@atproto/ozone": "^0.2.27",
51
- "@atproto/crypto": "^0.5.4",
52
- "@atproto/sync": "^0.4.3",
53
- "@atproto/pds": "^0.5.27",
51
+ "@atproto/pds": "^0.5.28",
52
+ "@atproto/sync": "^0.4.4",
54
53
  "@atproto/syntax": "^0.7.4",
55
- "@atproto/xrpc-server": "^0.12.3"
54
+ "@atproto/ozone": "^0.2.28",
55
+ "@atproto/xrpc-server": "^0.12.4"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@types/express": "^4.17.13"
package/src/network.ts CHANGED
@@ -69,6 +69,7 @@ export class TestNetwork extends TestNetworkNoAppView {
69
69
  const bsync = await TestBsync.create({
70
70
  apiKeys: [bsyncApiKey],
71
71
  dbUrl: dbPostgresUrl,
72
+ dbSchema: `bsync_${dbPostgresSchema}`,
72
73
  })
73
74
 
74
75
  const bsky = await TestBsky.create({