@atproto/dev-env 0.7.0 → 0.7.4

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,63 @@
1
1
  # @atproto/dev-env
2
2
 
3
+ ## 0.7.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`bce6f7e`](https://github.com/bluesky-social/atproto/commit/bce6f7e45897fc7c0f8217c412b54adbae36b774), [`d4f2c91`](https://github.com/bluesky-social/atproto/commit/d4f2c919697d37af8f411f724e12b8ce2b88f922), [`8c841f6`](https://github.com/bluesky-social/atproto/commit/8c841f6e73c8365c2dfe816c0613aa9c50490361)]:
8
+ - @atproto/ozone@0.12.3
9
+ - @atproto/api@0.30.3
10
+ - @atproto/bsky@0.5.3
11
+ - @atproto/pds@0.5.55
12
+ - @atproto/lex-schema@0.2.11
13
+ - @atproto/common-web@0.5.17
14
+ - @atproto/lex-client@0.4.2
15
+ - @atproto/sync@0.4.23
16
+ - @atproto/xrpc-server@0.13.9
17
+ - @atproto/bsync@0.1.8
18
+ - @atproto/identity@0.5.23
19
+ - @atproto/lexicon@0.7.19
20
+
21
+ ## 0.7.3
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies [[`8f12ce8`](https://github.com/bluesky-social/atproto/commit/8f12ce8bb8f5963bff137e100ec50a8f4b3739ae), [`7b640e8`](https://github.com/bluesky-social/atproto/commit/7b640e8fee709d22a0d62262068db0ddb3106741), [`9537a65`](https://github.com/bluesky-social/atproto/commit/9537a659a9d85bbeef1bb423fcb4be9d2e618ff2), [`43b0be2`](https://github.com/bluesky-social/atproto/commit/43b0be2fa15e49479c11254101a056e9da137c84), [`ba75afa`](https://github.com/bluesky-social/atproto/commit/ba75afad9fab6d1f5c207b1b5d12a7ecfc5b379d), [`b794e18`](https://github.com/bluesky-social/atproto/commit/b794e186bc81ce979d29de18f3ca9ab03b7e3d29)]:
26
+ - @atproto/bsky@0.5.2
27
+ - @atproto/api@0.30.2
28
+ - @atproto/ozone@0.12.2
29
+ - @atproto/pds@0.5.54
30
+ - @atproto/identity@0.5.22
31
+ - @atproto/sync@0.4.22
32
+
33
+ ## 0.7.2
34
+
35
+ ### Patch Changes
36
+
37
+ - [#5786](https://github.com/bluesky-social/atproto/pull/5786) [`07c25d4`](https://github.com/bluesky-social/atproto/commit/07c25d410d4f4ad8f6ec80fc14efa0dd8ec55545) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Depend on the `@atproto/lex-*` packages that `@atproto/lex` re-exports instead of `@atproto/lex`, which also installs the lexicon codegen tooling
38
+ - Updated dependencies [[`ee68c93`](https://github.com/bluesky-social/atproto/commit/ee68c9389ebec337d6af37fe373cfb506184040e), [`86c0b36`](https://github.com/bluesky-social/atproto/commit/86c0b362c5a044b8ca3a380438ae09735b3cf16e), [`07c25d4`](https://github.com/bluesky-social/atproto/commit/07c25d410d4f4ad8f6ec80fc14efa0dd8ec55545), [`7aa8e7e`](https://github.com/bluesky-social/atproto/commit/7aa8e7e9e1422f053447879def4d4cf92a05adbb), [`34dbe24`](https://github.com/bluesky-social/atproto/commit/34dbe242ce104b824e195862f97c6a250b444d18), [`7aa8e7e`](https://github.com/bluesky-social/atproto/commit/7aa8e7e9e1422f053447879def4d4cf92a05adbb), [`d38661d`](https://github.com/bluesky-social/atproto/commit/d38661dacd8afb19a2eb87eb8aa7e40656b37c92), [`07c25d4`](https://github.com/bluesky-social/atproto/commit/07c25d410d4f4ad8f6ec80fc14efa0dd8ec55545), [`799d2b9`](https://github.com/bluesky-social/atproto/commit/799d2b9e65845e1ff484717a933d16b069ba267e), [`11f52c5`](https://github.com/bluesky-social/atproto/commit/11f52c5588279d159ab12404a1b323731a467fdd), [`07c25d4`](https://github.com/bluesky-social/atproto/commit/07c25d410d4f4ad8f6ec80fc14efa0dd8ec55545)]:
39
+ - @atproto/pds@0.5.53
40
+ - @atproto/bsky@0.5.1
41
+ - @atproto/lex-client@0.4.1
42
+ - @atproto/lex-schema@0.2.10
43
+ - @atproto/ozone@0.12.1
44
+ - @atproto/sync@0.4.21
45
+ - @atproto/api@0.30.1
46
+ - @atproto/xrpc-server@0.13.8
47
+ - @atproto/common-web@0.5.16
48
+ - @atproto/identity@0.5.21
49
+ - @atproto/bsync@0.1.7
50
+ - @atproto/lexicon@0.7.18
51
+
52
+ ## 0.7.1
53
+
54
+ ### Patch Changes
55
+
56
+ - Updated dependencies [[`8060c82`](https://github.com/bluesky-social/atproto/commit/8060c82624aae800ce030d2c2096771c77e1fcad), [`bbfb9ce`](https://github.com/bluesky-social/atproto/commit/bbfb9ce8e9ed56380c766b66249d4c6b20b5f1a5), [`c2b5ce3`](https://github.com/bluesky-social/atproto/commit/c2b5ce39ebf1c33857595340a87551800689e8fd), [`e040958`](https://github.com/bluesky-social/atproto/commit/e0409585e6c5a82fd3fd0197c9d54fca74708bf7), [`a2dd244`](https://github.com/bluesky-social/atproto/commit/a2dd244d6072216735198db5777909d014b0638e), [`cde5838`](https://github.com/bluesky-social/atproto/commit/cde58383753aaf31f25c088e1219bc3378089a44), [`d6e1945`](https://github.com/bluesky-social/atproto/commit/d6e1945e095da70e0b188d5c6684a5797ce9ee8c), [`8562b17`](https://github.com/bluesky-social/atproto/commit/8562b172775167593fdf4d82cf4e0242d9d0189b), [`861d677`](https://github.com/bluesky-social/atproto/commit/861d677b6e908c7fd3f7f83a6d8dfed9c68896da), [`bbfb9ce`](https://github.com/bluesky-social/atproto/commit/bbfb9ce8e9ed56380c766b66249d4c6b20b5f1a5), [`d6e1945`](https://github.com/bluesky-social/atproto/commit/d6e1945e095da70e0b188d5c6684a5797ce9ee8c), [`15aacf4`](https://github.com/bluesky-social/atproto/commit/15aacf4299dc84a650d906e3aa6e82bde1b828d8)]:
57
+ - @atproto/bsky@0.5.0
58
+ - @atproto/ozone@0.12.0
59
+ - @atproto/api@0.30.0
60
+
3
61
  ## 0.7.0
4
62
 
5
63
  ### Minor Changes
package/dist/bsky.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { AtpAgent } from '@atproto/api';
2
2
  import * as bsky from '@atproto/bsky';
3
- import { Client, type UriString } from '@atproto/lex';
3
+ import { Client } from '@atproto/lex-client';
4
+ import type { UriString } from '@atproto/lex-schema';
4
5
  import type { DidString } from '@atproto/syntax';
5
6
  import type { BskyConfig } from './types.js';
6
7
  export * from '@atproto/bsky';
@@ -1 +1 @@
1
- {"version":3,"file":"bsky.d.ts","sourceRoot":"","sources":["../src/bsky.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,IAAI,MAAM,eAAe,CAAA;AAGrC,OAAO,EAAE,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAGhD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,cAAc,eAAe,CAAA;AAE7B,qBAAa,QAAQ;IAEV,GAAG,EAAE,SAAS;IACd,IAAI,EAAE,MAAM;IACZ,EAAE,EAAE,IAAI,CAAC,QAAQ;IACjB,MAAM,EAAE,IAAI,CAAC,WAAW;IACxB,SAAS,EAAE,IAAI,CAAC,eAAe;IAC/B,QAAQ,EAAE,IAAI,CAAC,iBAAiB;IAChC,GAAG,EAAE,IAAI,CAAC,gBAAgB;IAC1B,SAAS,EAAE,SAAS;IAR7B,YACS,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,IAAI,CAAC,QAAQ,EACjB,MAAM,EAAE,IAAI,CAAC,WAAW,EACxB,SAAS,EAAE,IAAI,CAAC,eAAe,EAC/B,QAAQ,EAAE,IAAI,CAAC,iBAAiB,EAChC,GAAG,EAAE,IAAI,CAAC,gBAAgB,EAC1B,SAAS,EAAE,SAAS,EACzB;IAEJ,OAAa,MAAM,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,C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zB;IAEJ,OAAa,MAAM,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,CA8HtD;IAED,IAAI,GAAG,IAAI,IAAI,CAAC,UAAU,CAEzB;IAED,QAAQ,IAAI,QAAQ,CAInB;IAED,SAAS,IAAI,MAAM,CAIlB;IAED,SAAS,IAAI,MAAM,CAMlB;IAED,gBAAgB;QAEZ,aAAa;MAEhB;IAEK,KAAK,kBAmBV;IAEK,CAAC,MAAM,CAAC,YAAY,CAAC,kBAE1B;CACF"}
package/dist/bsky.js CHANGED
@@ -4,7 +4,7 @@ import { AtpAgent } from '@atproto/api';
4
4
  import * as bsky from '@atproto/bsky';
5
5
  import { SECOND } from '@atproto/common-web';
6
6
  import { Secp256k1Keypair } from '@atproto/crypto';
7
- import { Client } from '@atproto/lex';
7
+ import { Client } from '@atproto/lex-client';
8
8
  import { ADMIN_PASSWORD, EXAMPLE_LABELER } from './const.js';
9
9
  import getPort from './get-port.js';
10
10
  export * from '@atproto/bsky';
package/dist/bsky.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bsky.js","sourceRoot":"","sources":["../src/bsky.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,GAAG,MAAM,aAAa,CAAA;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,IAAI,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,MAAM,EAAkB,MAAM,cAAc,CAAA;AAErD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,OAAO,MAAM,eAAe,CAAA;AAEnC,cAAc,eAAe,CAAA;AAE7B,MAAM,OAAO,QAAQ;IACnB,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AI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAA;YAC/B,CAAC;oBAAS,CAAC;gBACT,IAAI,CAAC;oBACH,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAA;gBAChC,CAAC;wBAAS,CAAC;oBACT,IAAI,CAAC;wBACH,MAAM,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAA;oBAC1B,CAAC;4BAAS,CAAC;wBACT,MAAM,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAA;oBACvB,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;QACzB,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;IACpB,CAAC;CACF","sourcesContent":["import { Client as PlcClient } from '@did-plc/lib'\nimport * as ui8 from 'uint8arrays'\nimport { AtpAgent } from '@atproto/api'\nimport * as bsky from '@atproto/bsky'\nimport { SECOND } from '@atproto/common-web'\nimport { Secp256k1Keypair } from '@atproto/crypto'\nimport { Client, type UriString } from '@atproto/lex'\nimport type { DidString } from '@atproto/syntax'\nimport { ADMIN_PASSWORD, EXAMPLE_LABELER } from './const.js'\nimport getPort from './get-port.js'\nimport type { BskyConfig } from './types.js'\nexport * from '@atproto/bsky'\n\nexport class TestBsky {\n constructor(\n public url: UriString,\n public port: number,\n public db: bsky.Database,\n public server: bsky.BskyAppView,\n public dataplane: bsky.DataPlaneServer,\n public bsyncSub: bsky.BsyncSubscription,\n public sub: bsky.RepoSubscription,\n public serverDid: DidString,\n ) {}\n\n static async create(cfg: BskyConfig): Promise<TestBsky> {\n const serviceKeypair = cfg.privateKey\n ? await Secp256k1Keypair.import(cfg.privateKey)\n : await Secp256k1Keypair.create()\n const plcClient = new PlcClient(cfg.plcUrl)\n\n const port = cfg.port || (await getPort())\n const url: UriString = `http://localhost:${port}`\n const serverDid = (await plcClient.createDid({\n signingKey: serviceKeypair.did(),\n rotationKeys: [serviceKeypair.did()],\n handle: 'bsky.test',\n pds: `http://localhost:${port}`,\n signer: serviceKeypair,\n })) as DidString\n\n const endpoint = `http://localhost:${port}`\n\n await plcClient.updateData(serverDid, serviceKeypair, (x) => {\n x.services['bsky_notif'] = {\n type: 'BskyNotificationService',\n endpoint,\n }\n x.services['bsky_appview'] = {\n type: 'BskyAppView',\n endpoint,\n }\n return x\n })\n\n // shared across server, ingester, and indexer in order to share pool, avoid too many pg connections.\n const db = new bsky.Database({\n url: cfg.dbPostgresUrl,\n schema: cfg.dbPostgresSchema,\n poolSize: 10,\n })\n\n const dataplanePort = await getPort()\n const dataplane = await bsky.DataPlaneServer.create(\n db,\n dataplanePort,\n cfg.plcUrl,\n // Resolves against an in-process PLC on localhost.\n globalThis.fetch,\n )\n\n const config = new bsky.ServerConfig({\n version: 'unknown',\n port,\n didPlcUrl: cfg.plcUrl,\n publicUrl: 'https://bsky.public.url',\n serverDid,\n alternateAudienceDids: [],\n dataplaneUrls: [`http://localhost:${dataplanePort}`],\n dataplaneHttpVersion: '1.1',\n bsyncHttpVersion: '1.1',\n bsyncApiKey: 'bsync-api-key',\n modServiceDid: cfg.modServiceDid ?? 'did:example:invalidMod',\n labelsFromIssuerDids: [EXAMPLE_LABELER],\n bigThreadUris: new Set(),\n maxThreadParents: cfg.maxThreadParents ?? 50,\n disableSsrfProtection: true,\n searchTagsHide: new Set(),\n searchTagsHideAll: new Set(),\n threadTagsBumpDown: new Set(),\n threadTagsHide: new Set(),\n visibilityTagHide: '',\n visibilityTagRankPrefix: '',\n debugFieldAllowedDids: new Set(),\n draftsLimit: 500,\n feedGenSkeletonTimeout: 5 * SECOND,\n ...cfg,\n notificationsV2MinRawLimit: cfg.notificationsV2MinRawLimit ?? 300,\n notificationsV2MaxRawItems: cfg.notificationsV2MaxRawItems ?? 3000,\n notificationsV2MaxFetches: cfg.notificationsV2MaxFetches ?? 3,\n notificationsV2MaxGroupItemsWithRelatedViews:\n cfg.notificationsV2MaxGroupItemsWithRelatedViews ?? 10,\n bskyFeedgenDids: cfg.bskyFeedgenDids ?? new Set(),\n adminPasswords: [ADMIN_PASSWORD],\n etcdHosts: [],\n })\n\n // Separate migration db in case migration changes some connection state that we need in the tests, e.g. \"alter database ... set ...\"\n const migrationDb = new bsky.Database({\n url: cfg.dbPostgresUrl,\n schema: cfg.dbPostgresSchema,\n })\n if (cfg.migration) {\n await migrationDb.migrateToOrThrow(cfg.migration)\n } else {\n await migrationDb.migrateToLatestOrThrow()\n }\n await migrationDb.close()\n\n // api server\n const server = bsky.BskyAppView.create({\n config,\n signingKey: serviceKeypair,\n })\n\n const bsyncSub = new bsky.BsyncSubscription({\n config,\n db,\n })\n\n const sub = new bsky.RepoSubscription({\n service: cfg.repoProvider,\n db,\n idResolver: dataplane.idResolver,\n })\n\n await server.start()\n\n bsyncSub.start()\n void sub.start()\n\n return new TestBsky(\n url,\n port,\n db,\n server,\n dataplane,\n bsyncSub,\n sub,\n serverDid,\n )\n }\n\n get ctx(): bsky.AppContext {\n return this.server.ctx\n }\n\n getAgent(): AtpAgent {\n const agent = new AtpAgent({ service: this.url })\n agent.configureLabelers([EXAMPLE_LABELER])\n return agent\n }\n\n getClient(): Client {\n const client = new Client({ service: this.url })\n client.setLabelers([EXAMPLE_LABELER])\n return client\n }\n\n adminAuth(): string {\n const [password] = this.ctx.cfg.adminPasswords\n return (\n 'Basic ' +\n ui8.toString(ui8.fromString(`admin:${password}`, 'utf8'), 'base64pad')\n )\n }\n\n adminAuthHeaders() {\n return {\n authorization: this.adminAuth(),\n }\n }\n\n async close() {\n // @TODO Use disposable stack when it becomes available (Node24+)\n try {\n await this.server.destroy()\n } finally {\n try {\n await this.bsyncSub.destroy()\n } finally {\n try {\n await this.dataplane.destroy()\n } finally {\n try {\n await this.sub.destroy()\n } finally {\n await this.db.close()\n }\n }\n }\n }\n }\n\n async [Symbol.asyncDispose]() {\n await this.close()\n }\n}\n"]}
1
+ {"version":3,"file":"bsky.js","sourceRoot":"","sources":["../src/bsky.ts"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AA;IACf,CAAC;IAED,SAAS;QACP,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAA;QAC9C,OAAO,CACL,QAAQ;YACR,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,SAAS,QAAQ,EAAE,EAAE,MAAM,CAAC,EAAE,WAAW,CAAC,CACvE,CAAA;IACH,CAAC;IAED,gBAAgB;QACd,OAAO;YACL,aAAa,EAAE,IAAI,CAAC,SAAS,EAAE;SAChC,CAAA;IACH,CAAC;IAED,KAAK,CAAC,KAAK;QACT,iEAAiE;QACjE,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAA;QAC7B,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC;gBACH,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAA;YAC/B,CAAC;oBAAS,CAAC;gBACT,IAAI,CAAC;oBACH,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAA;gBAChC,CAAC;wBAAS,CAAC;oBACT,IAAI,CAAC;wBACH,MAAM,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAA;oBAC1B,CAAC;4BAAS,CAAC;wBACT,MAAM,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAA;oBACvB,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;QACzB,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;IACpB,CAAC;CACF","sourcesContent":["import { Client as PlcClient } from '@did-plc/lib'\nimport * as ui8 from 'uint8arrays'\nimport { AtpAgent } from '@atproto/api'\nimport * as bsky from '@atproto/bsky'\nimport { SECOND } from '@atproto/common-web'\nimport { Secp256k1Keypair } from '@atproto/crypto'\nimport { Client } from '@atproto/lex-client'\nimport type { UriString } from '@atproto/lex-schema'\nimport type { DidString } from '@atproto/syntax'\nimport { ADMIN_PASSWORD, EXAMPLE_LABELER } from './const.js'\nimport getPort from './get-port.js'\nimport type { BskyConfig } from './types.js'\nexport * from '@atproto/bsky'\n\nexport class TestBsky {\n constructor(\n public url: UriString,\n public port: number,\n public db: bsky.Database,\n public server: bsky.BskyAppView,\n public dataplane: bsky.DataPlaneServer,\n public bsyncSub: bsky.BsyncSubscription,\n public sub: bsky.RepoSubscription,\n public serverDid: DidString,\n ) {}\n\n static async create(cfg: BskyConfig): Promise<TestBsky> {\n const serviceKeypair = cfg.privateKey\n ? await Secp256k1Keypair.import(cfg.privateKey)\n : await Secp256k1Keypair.create()\n const plcClient = new PlcClient(cfg.plcUrl)\n\n const port = cfg.port || (await getPort())\n const url: UriString = `http://localhost:${port}`\n const serverDid = (await plcClient.createDid({\n signingKey: serviceKeypair.did(),\n rotationKeys: [serviceKeypair.did()],\n handle: 'bsky.test',\n pds: `http://localhost:${port}`,\n signer: serviceKeypair,\n })) as DidString\n\n const endpoint = `http://localhost:${port}`\n\n await plcClient.updateData(serverDid, serviceKeypair, (x) => {\n x.services['bsky_notif'] = {\n type: 'BskyNotificationService',\n endpoint,\n }\n x.services['bsky_appview'] = {\n type: 'BskyAppView',\n endpoint,\n }\n return x\n })\n\n // shared across server, ingester, and indexer in order to share pool, avoid too many pg connections.\n const db = new bsky.Database({\n url: cfg.dbPostgresUrl,\n schema: cfg.dbPostgresSchema,\n poolSize: 10,\n })\n\n const dataplanePort = await getPort()\n const dataplane = await bsky.DataPlaneServer.create(\n db,\n dataplanePort,\n cfg.plcUrl,\n // Resolves against an in-process PLC on localhost.\n globalThis.fetch,\n )\n\n const config = new bsky.ServerConfig({\n version: 'unknown',\n port,\n didPlcUrl: cfg.plcUrl,\n publicUrl: 'https://bsky.public.url',\n serverDid,\n alternateAudienceDids: [],\n dataplaneUrls: [`http://localhost:${dataplanePort}`],\n dataplaneHttpVersion: '1.1',\n bsyncHttpVersion: '1.1',\n bsyncApiKey: 'bsync-api-key',\n modServiceDid: cfg.modServiceDid ?? 'did:example:invalidMod',\n labelsFromIssuerDids: [EXAMPLE_LABELER],\n bigThreadUris: new Set(),\n maxThreadParents: cfg.maxThreadParents ?? 50,\n disableSsrfProtection: true,\n searchTagsHide: new Set(),\n searchTagsHideAll: new Set(),\n threadTagsBumpDown: new Set(),\n threadTagsHide: new Set(),\n visibilityTagHide: '',\n visibilityTagRankPrefix: '',\n debugFieldAllowedDids: new Set(),\n draftsLimit: 500,\n feedGenSkeletonTimeout: 5 * SECOND,\n ...cfg,\n notificationsV2MinRawLimit: cfg.notificationsV2MinRawLimit ?? 300,\n notificationsV2MaxRawItems: cfg.notificationsV2MaxRawItems ?? 3000,\n notificationsV2MaxFetches: cfg.notificationsV2MaxFetches ?? 3,\n notificationsV2MaxGroupItemsWithRelatedViews:\n cfg.notificationsV2MaxGroupItemsWithRelatedViews ?? 10,\n bskyFeedgenDids: cfg.bskyFeedgenDids ?? new Set(),\n adminPasswords: [ADMIN_PASSWORD],\n etcdHosts: [],\n })\n\n // Separate migration db in case migration changes some connection state that we need in the tests, e.g. \"alter database ... set ...\"\n const migrationDb = new bsky.Database({\n url: cfg.dbPostgresUrl,\n schema: cfg.dbPostgresSchema,\n })\n if (cfg.migration) {\n await migrationDb.migrateToOrThrow(cfg.migration)\n } else {\n await migrationDb.migrateToLatestOrThrow()\n }\n await migrationDb.close()\n\n // api server\n const server = bsky.BskyAppView.create({\n config,\n signingKey: serviceKeypair,\n })\n\n const bsyncSub = new bsky.BsyncSubscription({\n config,\n db,\n })\n\n const sub = new bsky.RepoSubscription({\n service: cfg.repoProvider,\n db,\n idResolver: dataplane.idResolver,\n })\n\n await server.start()\n\n bsyncSub.start()\n void sub.start()\n\n return new TestBsky(\n url,\n port,\n db,\n server,\n dataplane,\n bsyncSub,\n sub,\n serverDid,\n )\n }\n\n get ctx(): bsky.AppContext {\n return this.server.ctx\n }\n\n getAgent(): AtpAgent {\n const agent = new AtpAgent({ service: this.url })\n agent.configureLabelers([EXAMPLE_LABELER])\n return agent\n }\n\n getClient(): Client {\n const client = new Client({ service: this.url })\n client.setLabelers([EXAMPLE_LABELER])\n return client\n }\n\n adminAuth(): string {\n const [password] = this.ctx.cfg.adminPasswords\n return (\n 'Basic ' +\n ui8.toString(ui8.fromString(`admin:${password}`, 'utf8'), 'base64pad')\n )\n }\n\n adminAuthHeaders() {\n return {\n authorization: this.adminAuth(),\n }\n }\n\n async close() {\n // @TODO Use disposable stack when it becomes available (Node24+)\n try {\n await this.server.destroy()\n } finally {\n try {\n await this.bsyncSub.destroy()\n } finally {\n try {\n await this.dataplane.destroy()\n } finally {\n try {\n await this.sub.destroy()\n } finally {\n await this.db.close()\n }\n }\n }\n }\n }\n\n async [Symbol.asyncDispose]() {\n await this.close()\n }\n}\n"]}
package/dist/ozone.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { AtpAgent } from '@atproto/api';
2
2
  import { type Keypair } from '@atproto/crypto';
3
- import { Client, type DidString } from '@atproto/lex';
3
+ import { Client } from '@atproto/lex-client';
4
+ import type { DidString } from '@atproto/lex-schema';
4
5
  import * as ozone from '@atproto/ozone';
5
6
  import { ModeratorClient } from './moderator-client.js';
6
7
  import type { DidAndKey, OzoneConfig } from './types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"ozone.d.ts","sourceRoot":"","sources":["../src/ozone.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,KAAK,OAAO,EAAoB,MAAM,iBAAiB,CAAA;AAChE,OAAO,EAAE,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAA;AAIvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAGxD,qBAAa,SAAS;IAEX,GAAG,EAAE,M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Ac,WACjB,MAAM,WACL,OAAO,KACf,OAAO,CAAC,SAAS,CAuBnB,CAAA"}
package/dist/ozone.js CHANGED
@@ -2,7 +2,7 @@ import * as plc from '@did-plc/lib';
2
2
  import * as ui8 from 'uint8arrays';
3
3
  import { AtpAgent } from '@atproto/api';
4
4
  import { Secp256k1Keypair } from '@atproto/crypto';
5
- import { Client } from '@atproto/lex';
5
+ import { Client } from '@atproto/lex-client';
6
6
  import * as ozone from '@atproto/ozone';
7
7
  import { createServiceJwt } from '@atproto/xrpc-server';
8
8
  import { ADMIN_PASSWORD, EXAMPLE_LABELER } from './const.js';
package/dist/ozone.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ozone.js","sourceRoot":"","sources":["../src/ozone.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,GAAG,MAAM,aAAa,CAAA;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAgB,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAChE,OAAO,EAAE,MAAM,EAAkB,MAAM,cAAc,CAAA;AACrD,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,OAAO,MAAM,eAAe,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE3C,MAAM,OAAO,SAAS;IACpB,YACS,GAAW,EACX,IAAY,EACZ,MAA0B,EAC1B,MAAyB,EACzB,UAAqB,EACrB,cAAyB,EACzB,WAAsB;mBANtB,GAAG;oBACH,IAAI;sBACJ,MAAM;sBACN,MAAM;0BACN,UAAU;8BACV,cAAc;2BACd,WAAW;IACjB,CAAC;I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AAC,MAAM,CAAC,CAAA;IACxC,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,aAAa,CACnC;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,EAAE;QACf,YAAY,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;QAC7B,mBAAmB,EAAE;YACnB,aAAa,EAAE,OAAO,CAAC,GAAG,EAAE;SAC7B;QACD,QAAQ,EAAE;YACR,eAAe,EAAE;gBACf,IAAI,EAAE,gBAAgB;gBACtB,QAAQ,EAAE,0BAA0B;aACrC;SACF;QACD,IAAI,EAAE,IAAI;KACX,EACD,OAAO,CACR,CAAA;IACD,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;IAC3C,MAAM,SAAS,CAAC,aAAa,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IACzC,OAAO,GAAgB,CAAA;AACzB,CAAC,CAAA","sourcesContent":["import * as plc from '@did-plc/lib'\nimport * as ui8 from 'uint8arrays'\nimport { AtpAgent } from '@atproto/api'\nimport { type Keypair, Secp256k1Keypair } from '@atproto/crypto'\nimport { Client, type DidString } from '@atproto/lex'\nimport * as ozone from '@atproto/ozone'\nimport { createServiceJwt } from '@atproto/xrpc-server'\nimport { ADMIN_PASSWORD, EXAMPLE_LABELER } from './const.js'\nimport getPort from './get-port.js'\nimport { ModeratorClient } from './moderator-client.js'\nimport type { DidAndKey, OzoneConfig } from './types.js'\nimport { createDidAndKey } from './util.js'\n\nexport class TestOzone {\n constructor(\n public url: string,\n public port: number,\n public server: ozone.OzoneService,\n public daemon: ozone.OzoneDaemon,\n public adminAccnt: DidAndKey,\n public moderatorAccnt: DidAndKey,\n public triageAccnt: DidAndKey,\n ) {}\n\n static async create(config: OzoneConfig): Promise<TestOzone> {\n const serviceKeypair =\n config.signingKey ?? (await Secp256k1Keypair.create({ exportable: true }))\n const signingKeyHex = ui8.toString(await serviceKeypair.export(), 'hex')\n let serverDid = config.serverDid\n if (!serverDid) {\n serverDid = await createOzoneDid(config.plcUrl, serviceKeypair)\n }\n\n const admin = await createDidAndKey({\n plcUrl: config.plcUrl,\n handle: 'admin.ozone',\n pds: 'https://pds.invalid',\n })\n\n const moderator = await createDidAndKey({\n plcUrl: config.plcUrl,\n handle: 'moderator.ozone',\n pds: 'https://pds.invalid',\n })\n\n const triage = await createDidAndKey({\n plcUrl: config.plcUrl,\n handle: 'triage.ozone',\n pds: 'https://pds.invalid',\n })\n\n const port = config.port || (await getPort())\n const url = `http://localhost:${port}`\n\n const env: ozone.OzoneEnvironment = {\n devMode: true,\n version: '0.0.0',\n port,\n didPlcUrl: config.plcUrl,\n publicUrl: url,\n serverDid,\n signingKeyHex,\n ...config,\n adminPassword: ADMIN_PASSWORD,\n adminDids: [...(config.adminDids ?? []), admin.did],\n moderatorDids: [\n ...(config.moderatorDids ?? []),\n config.appviewDid,\n moderator.did,\n ],\n triageDids: [...(config.triageDids ?? []), triage.did],\n }\n\n // Separate migration db in case migration changes some connection state that we need in the tests, e.g. \"alter database ... set ...\"\n const migrationDb = new ozone.Database({\n schema: config.dbPostgresSchema,\n url: config.dbPostgresUrl,\n })\n if (config.migration) {\n await migrationDb.migrateToOrThrow(config.migration)\n } else {\n await migrationDb.migrateToLatestOrThrow()\n }\n await migrationDb.close()\n\n const cfg = ozone.envToCfg(env)\n const secrets = ozone.envToSecrets(env)\n\n // api server\n const server = await ozone.OzoneService.create(cfg, secrets, {\n imgInvalidator: config.imgInvalidator,\n videoInvalidator: config.videoInvalidator,\n })\n await server.start()\n\n const daemon = await ozone.OzoneDaemon.create(cfg, secrets)\n await daemon.start()\n // don't do event reversal in dev-env\n await daemon.ctx.eventReverser.destroy()\n\n return new TestOzone(url, port, server, daemon, admin, moderator, triage)\n }\n\n get ctx(): ozone.AppContext {\n return this.server.ctx\n }\n\n /** @deprecated use {@link getClient} instead */\n getAgent(): AtpAgent {\n const agent = new AtpAgent({ service: this.url })\n agent.configureLabelers([EXAMPLE_LABELER])\n return agent\n }\n\n getClient(): Client {\n return new Client(this.url, {\n labelers: [EXAMPLE_LABELER],\n })\n }\n\n getModClient() {\n return new ModeratorClient(this)\n }\n\n async addAdminDid(did: DidString) {\n await this.ctx.teamService(this.ctx.db).create({\n did,\n disabled: false,\n handle: null,\n displayName: null,\n lastUpdatedBy: this.ctx.cfg.service.did,\n role: 'tools.ozone.team.defs#roleAdmin',\n })\n this.ctx.cfg.access.admins.push(did)\n }\n\n async addModeratorDid(did: DidString) {\n await this.ctx.teamService(this.ctx.db).create({\n did,\n disabled: false,\n handle: null,\n displayName: null,\n lastUpdatedBy: this.ctx.cfg.service.did,\n role: 'tools.ozone.team.defs#roleModerator',\n })\n this.ctx.cfg.access.moderators.push(did)\n }\n\n async addTriageDid(did: DidString) {\n await this.ctx.teamService(this.ctx.db).create({\n did,\n disabled: false,\n handle: null,\n displayName: null,\n lastUpdatedBy: this.ctx.cfg.service.did,\n role: 'tools.ozone.team.defs#roleTriage',\n })\n this.ctx.cfg.access.triage.push(did)\n }\n\n async createPolicies() {\n const now = new Date()\n const defaultOptions = {\n managerRole: 'tools.ozone.team.defs#roleAdmin' as const,\n scope: 'instance' as const,\n did: this.ctx.cfg.service.did,\n lastUpdatedBy: this.ctx.cfg.service.did,\n createdBy: this.ctx.cfg.service.did,\n createdAt: now,\n updatedAt: now,\n }\n await this.ctx.settingService(this.ctx.db).upsert({\n ...defaultOptions,\n key: 'tools.ozone.setting.severityLevels',\n value: {\n 'sev-2': {\n strikeCount: 2,\n expiryInDays: 90,\n },\n 'sev-4': {\n strikeCount: 4,\n expiryInDays: 365,\n },\n 'sev-7': {\n needsTakedown: true,\n description: 'Sever violation, immedate account takedown',\n },\n 'custom-sev': {\n strikeCount: 4,\n firstOccurrenceStrikeCount: 8,\n description: 'First offense harsher penalty, on subsequent less',\n },\n },\n description: 'Severity levels and strike count mapping for policies',\n })\n await this.ctx.settingService(this.ctx.db).upsert({\n ...defaultOptions,\n key: 'tools.ozone.setting.policyList',\n value: {\n 'policy-one': {\n name: 'Policy One',\n description: 'Policy for handling user behavior',\n severityLevels: {\n 'sev-1': {\n description: 'Minor infraction',\n isDefault: true,\n },\n 'sev-2': {\n description: 'Moderate infraction',\n isDefault: false,\n },\n },\n },\n 'policy-two': {\n name: 'Policy Two',\n description: 'Policy for handling user action',\n severityLevels: {\n 'sev-4': {\n description: 'Moderate infraction',\n isDefault: false,\n },\n 'sev-5': {\n description: 'Severe infraction',\n isDefault: false,\n },\n },\n },\n },\n description: 'Moderation policies to be associated with actions',\n })\n }\n\n async modHeaders(\n lxm: string,\n role: 'admin' | 'moderator' | 'triage' = 'moderator',\n ) {\n const account =\n role === 'admin'\n ? this.adminAccnt\n : role === 'moderator'\n ? this.moderatorAccnt\n : this.triageAccnt\n const jwt = await createServiceJwt({\n iss: account.did,\n aud: this.ctx.cfg.service.did,\n lxm,\n keypair: account.key,\n })\n return { authorization: `Bearer ${jwt}` }\n }\n\n async processAll() {\n await this.ctx.backgroundQueue.processAll()\n await this.daemon.processAll()\n }\n\n async close() {\n try {\n await this.server.destroy()\n } finally {\n await this.daemon.destroy()\n }\n }\n\n async [Symbol.asyncDispose]() {\n await this.close()\n }\n}\n\nexport const createOzoneDid = async (\n plcUrl: string,\n keypair: Keypair,\n): Promise<DidString> => {\n const plcClient = new plc.Client(plcUrl)\n const plcOp = await plc.signOperation(\n {\n type: 'plc_operation',\n alsoKnownAs: [],\n rotationKeys: [keypair.did()],\n verificationMethods: {\n atproto_label: keypair.did(),\n },\n services: {\n atproto_labeler: {\n type: 'AtprotoLabeler',\n endpoint: 'https://ozone.public.url',\n },\n },\n prev: null,\n },\n keypair,\n )\n const did = await plc.didForCreateOp(plcOp)\n await plcClient.sendOperation(did, plcOp)\n return did as DidString\n}\n"]}
1
+ {"version":3,"file":"ozone.js","sourceRoot":"","sources":["../src/ozone.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,GAAG,MAAM,aAAa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,CAAA;AACzB,CAAC,CAAA","sourcesContent":["import * as plc from '@did-plc/lib'\nimport * as ui8 from 'uint8arrays'\nimport { AtpAgent } from '@atproto/api'\nimport { type Keypair, Secp256k1Keypair } from '@atproto/crypto'\nimport { Client } from '@atproto/lex-client'\nimport type { DidString } from '@atproto/lex-schema'\nimport * as ozone from '@atproto/ozone'\nimport { createServiceJwt } from '@atproto/xrpc-server'\nimport { ADMIN_PASSWORD, EXAMPLE_LABELER } from './const.js'\nimport getPort from './get-port.js'\nimport { ModeratorClient } from './moderator-client.js'\nimport type { DidAndKey, OzoneConfig } from './types.js'\nimport { createDidAndKey } from './util.js'\n\nexport class TestOzone {\n constructor(\n public url: string,\n public port: number,\n public server: ozone.OzoneService,\n public daemon: ozone.OzoneDaemon,\n public adminAccnt: DidAndKey,\n public moderatorAccnt: DidAndKey,\n public triageAccnt: DidAndKey,\n ) {}\n\n static async create(config: OzoneConfig): Promise<TestOzone> {\n const serviceKeypair =\n config.signingKey ?? (await Secp256k1Keypair.create({ exportable: true }))\n const signingKeyHex = ui8.toString(await serviceKeypair.export(), 'hex')\n let serverDid = config.serverDid\n if (!serverDid) {\n serverDid = await createOzoneDid(config.plcUrl, serviceKeypair)\n }\n\n const admin = await createDidAndKey({\n plcUrl: config.plcUrl,\n handle: 'admin.ozone',\n pds: 'https://pds.invalid',\n })\n\n const moderator = await createDidAndKey({\n plcUrl: config.plcUrl,\n handle: 'moderator.ozone',\n pds: 'https://pds.invalid',\n })\n\n const triage = await createDidAndKey({\n plcUrl: config.plcUrl,\n handle: 'triage.ozone',\n pds: 'https://pds.invalid',\n })\n\n const port = config.port || (await getPort())\n const url = `http://localhost:${port}`\n\n const env: ozone.OzoneEnvironment = {\n devMode: true,\n version: '0.0.0',\n port,\n didPlcUrl: config.plcUrl,\n publicUrl: url,\n serverDid,\n signingKeyHex,\n ...config,\n adminPassword: ADMIN_PASSWORD,\n adminDids: [...(config.adminDids ?? []), admin.did],\n moderatorDids: [\n ...(config.moderatorDids ?? []),\n config.appviewDid,\n moderator.did,\n ],\n triageDids: [...(config.triageDids ?? []), triage.did],\n }\n\n // Separate migration db in case migration changes some connection state that we need in the tests, e.g. \"alter database ... set ...\"\n const migrationDb = new ozone.Database({\n schema: config.dbPostgresSchema,\n url: config.dbPostgresUrl,\n })\n if (config.migration) {\n await migrationDb.migrateToOrThrow(config.migration)\n } else {\n await migrationDb.migrateToLatestOrThrow()\n }\n await migrationDb.close()\n\n const cfg = ozone.envToCfg(env)\n const secrets = ozone.envToSecrets(env)\n\n // api server\n const server = await ozone.OzoneService.create(cfg, secrets, {\n imgInvalidator: config.imgInvalidator,\n videoInvalidator: config.videoInvalidator,\n })\n await server.start()\n\n const daemon = await ozone.OzoneDaemon.create(cfg, secrets)\n await daemon.start()\n // don't do event reversal in dev-env\n await daemon.ctx.eventReverser.destroy()\n\n return new TestOzone(url, port, server, daemon, admin, moderator, triage)\n }\n\n get ctx(): ozone.AppContext {\n return this.server.ctx\n }\n\n /** @deprecated use {@link getClient} instead */\n getAgent(): AtpAgent {\n const agent = new AtpAgent({ service: this.url })\n agent.configureLabelers([EXAMPLE_LABELER])\n return agent\n }\n\n getClient(): Client {\n return new Client(this.url, {\n labelers: [EXAMPLE_LABELER],\n })\n }\n\n getModClient() {\n return new ModeratorClient(this)\n }\n\n async addAdminDid(did: DidString) {\n await this.ctx.teamService(this.ctx.db).create({\n did,\n disabled: false,\n handle: null,\n displayName: null,\n lastUpdatedBy: this.ctx.cfg.service.did,\n role: 'tools.ozone.team.defs#roleAdmin',\n })\n this.ctx.cfg.access.admins.push(did)\n }\n\n async addModeratorDid(did: DidString) {\n await this.ctx.teamService(this.ctx.db).create({\n did,\n disabled: false,\n handle: null,\n displayName: null,\n lastUpdatedBy: this.ctx.cfg.service.did,\n role: 'tools.ozone.team.defs#roleModerator',\n })\n this.ctx.cfg.access.moderators.push(did)\n }\n\n async addTriageDid(did: DidString) {\n await this.ctx.teamService(this.ctx.db).create({\n did,\n disabled: false,\n handle: null,\n displayName: null,\n lastUpdatedBy: this.ctx.cfg.service.did,\n role: 'tools.ozone.team.defs#roleTriage',\n })\n this.ctx.cfg.access.triage.push(did)\n }\n\n async createPolicies() {\n const now = new Date()\n const defaultOptions = {\n managerRole: 'tools.ozone.team.defs#roleAdmin' as const,\n scope: 'instance' as const,\n did: this.ctx.cfg.service.did,\n lastUpdatedBy: this.ctx.cfg.service.did,\n createdBy: this.ctx.cfg.service.did,\n createdAt: now,\n updatedAt: now,\n }\n await this.ctx.settingService(this.ctx.db).upsert({\n ...defaultOptions,\n key: 'tools.ozone.setting.severityLevels',\n value: {\n 'sev-2': {\n strikeCount: 2,\n expiryInDays: 90,\n },\n 'sev-4': {\n strikeCount: 4,\n expiryInDays: 365,\n },\n 'sev-7': {\n needsTakedown: true,\n description: 'Sever violation, immedate account takedown',\n },\n 'custom-sev': {\n strikeCount: 4,\n firstOccurrenceStrikeCount: 8,\n description: 'First offense harsher penalty, on subsequent less',\n },\n },\n description: 'Severity levels and strike count mapping for policies',\n })\n await this.ctx.settingService(this.ctx.db).upsert({\n ...defaultOptions,\n key: 'tools.ozone.setting.policyList',\n value: {\n 'policy-one': {\n name: 'Policy One',\n description: 'Policy for handling user behavior',\n severityLevels: {\n 'sev-1': {\n description: 'Minor infraction',\n isDefault: true,\n },\n 'sev-2': {\n description: 'Moderate infraction',\n isDefault: false,\n },\n },\n },\n 'policy-two': {\n name: 'Policy Two',\n description: 'Policy for handling user action',\n severityLevels: {\n 'sev-4': {\n description: 'Moderate infraction',\n isDefault: false,\n },\n 'sev-5': {\n description: 'Severe infraction',\n isDefault: false,\n },\n },\n },\n },\n description: 'Moderation policies to be associated with actions',\n })\n }\n\n async modHeaders(\n lxm: string,\n role: 'admin' | 'moderator' | 'triage' = 'moderator',\n ) {\n const account =\n role === 'admin'\n ? this.adminAccnt\n : role === 'moderator'\n ? this.moderatorAccnt\n : this.triageAccnt\n const jwt = await createServiceJwt({\n iss: account.did,\n aud: this.ctx.cfg.service.did,\n lxm,\n keypair: account.key,\n })\n return { authorization: `Bearer ${jwt}` }\n }\n\n async processAll() {\n await this.ctx.backgroundQueue.processAll()\n await this.daemon.processAll()\n }\n\n async close() {\n try {\n await this.server.destroy()\n } finally {\n await this.daemon.destroy()\n }\n }\n\n async [Symbol.asyncDispose]() {\n await this.close()\n }\n}\n\nexport const createOzoneDid = async (\n plcUrl: string,\n keypair: Keypair,\n): Promise<DidString> => {\n const plcClient = new plc.Client(plcUrl)\n const plcOp = await plc.signOperation(\n {\n type: 'plc_operation',\n alsoKnownAs: [],\n rotationKeys: [keypair.did()],\n verificationMethods: {\n atproto_label: keypair.did(),\n },\n services: {\n atproto_labeler: {\n type: 'AtprotoLabeler',\n endpoint: 'https://ozone.public.url',\n },\n },\n prev: null,\n },\n keypair,\n )\n const did = await plc.didForCreateOp(plcOp)\n await plcClient.sendOperation(did, plcOp)\n return did as DidString\n}\n"]}
package/dist/pds.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { AtpAgent } from '@atproto/api';
2
- import { Client, type UriString } from '@atproto/lex';
2
+ import { Client } from '@atproto/lex-client';
3
+ import type { UriString } from '@atproto/lex-schema';
3
4
  import { type AppContext, type AppContextOptions, type KeyObject, PDS } from '@atproto/pds';
4
5
  import type { PdsConfig } from './types.js';
5
6
  export { AtpAgent, Client, PDS };
package/dist/pds.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"pds.d.ts","sourceRoot":"","sources":["../src/pds.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC,OAAO,EAAE,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,EACL,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,GAAG,EAEJ,MAAM,cAAc,CAAA;AAGrB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAG3C,OAAO,EAAE,QAAQ,EAAE,M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SAAS;IACd,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,GAAG;IAHpB,YACS,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,GAAG,EAChB;IAEJ,OAAa,MAAM,CACjB,GAAG,EAAE,SAAS,EACd,SAAS,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GACrC,OAAO,CAAC,OAAO,CAAC,CAgDlB;IAED,IAAI,GAAG,IAAI,UAAU,CAEpB;IAED,QAAQ,IAAI,QAAQ,CAInB;IAED,SAAS,IAAI,MAAM,CAIlB;IAED,SAAS,IAAI,MAAM,CAQlB;IAED,gBAAgB;QAEZ,aAAa;MAEhB;IAED,YAAY,cAEX;IAEK,UAAU,kBAEf;IAEK,KAAK,kBAEV;IAEK,CAAC,MAAM,CAAC,YAAY,CAAC,kBAE1B;CACF"}
package/dist/pds.js CHANGED
@@ -4,7 +4,7 @@ import path from 'node:path';
4
4
  import * as ui8 from 'uint8arrays';
5
5
  import { AtpAgent } from '@atproto/api';
6
6
  import { Secp256k1Keypair, randomStr } from '@atproto/crypto';
7
- import { Client } from '@atproto/lex';
7
+ import { Client } from '@atproto/lex-client';
8
8
  import { PDS, createSecretKeyObject, } from '@atproto/pds';
9
9
  import { ADMIN_PASSWORD, EXAMPLE_LABELER, JWT_SECRET } from './const.js';
10
10
  import getPort from './get-port.js';
package/dist/pds.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"pds.js","sourceRoot":"","sources":["../src/pds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAA;AACjC,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,KAAK,GAAG,MAAM,aAAa,CAAA;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,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CAAC,EACjD,WAAW,CACZ,CACF,CAAA;IACH,CAAC;IAED,gBAAgB;QACd,OAAO;YACL,aAAa,EAAE,IAAI,CAAC,SAAS,EAAE;SAChC,CAAA;IACH,CAAC;IAED,YAAY;QACV,OAAO,qBAAqB,CAAC,UAAU,CAAC,CAAA;IAC1C,CAAC;IAED,KAAK,CAAC,UAAU;QACd,MAAM,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,UAAU,EAAE,CAAA;IAC7C,CAAC;IAED,KAAK,CAAC,KAAK;QACT,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAA;IAC7B,CAAC;IAED,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;QACzB,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;IACpB,CAAC;CACF;AAED,KAAK,UAAU,iBAAiB;IAC9B,MAAM,cAAc,GAAG,MAAM,gBAAgB,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAA;IAC1E,MAAM,eAAe,GAAG,MAAM,cAAc,CAAC,MAAM,EAAE,CAAA;IACrD,OAAO,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AACrD,CAAC;AAED,KAAK,UAAU,QAAQ;IACrB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAA;IAC/D,MAAM,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAC7C,OAAO,QAAQ,CAAA;AACjB,CAAC","sourcesContent":["import fs from 'node:fs/promises'\nimport os from 'node:os'\nimport path from 'node:path'\nimport * as ui8 from 'uint8arrays'\nimport { AtpAgent } from '@atproto/api'\nimport { Secp256k1Keypair, randomStr } from '@atproto/crypto'\nimport { Client, type UriString } from '@atproto/lex'\nimport {\n type AppContext,\n type AppContextOptions,\n type KeyObject,\n PDS,\n createSecretKeyObject,\n} from '@atproto/pds'\nimport { ADMIN_PASSWORD, EXAMPLE_LABELER, JWT_SECRET } from './const.js'\nimport getPort from './get-port.js'\nimport type { PdsConfig } from './types.js'\n\n// Re-export types that are part of the public API\nexport { AtpAgent, Client, PDS }\nexport type { AppContextOptions, KeyObject, PdsConfig, UriString }\n\nexport class TestPds {\n constructor(\n public url: UriString,\n public port: number,\n public server: PDS,\n ) {}\n\n static async create(\n env: PdsConfig,\n overrides?: Partial<AppContextOptions>,\n ): Promise<TestPds> {\n const recoveryKey = (await Secp256k1Keypair.create()).did()\n\n const port = env.port || (await getPort())\n const url: UriString = `http://localhost:${port}`\n\n const server = await PDS.fromEnv(\n {\n devMode: true,\n port,\n dataDirectory: await mkTmpdir(),\n blobstoreDiskLocation: await mkTmpdir(),\n recoveryDidKey: recoveryKey,\n adminPassword: ADMIN_PASSWORD,\n jwtSecret: JWT_SECRET,\n // @NOTE \".example\" will not actually work and is only used to display\n // multiple domains in the sing-up UI\n serviceHandleDomains: ['.test', '.example'],\n bskyAppViewUrl: 'https://appview.invalid',\n bskyAppViewDid: 'did:example:invalid',\n bskyAppViewCdnUrlPattern: 'http://cdn.appview.com/%s/%s/%s',\n modServiceUrl: 'https://moderator.invalid',\n modServiceDid: 'did:example:invalid',\n plcRotationKeyK256PrivateKeyHex: overrides?.plcRotationKey\n ? undefined // @NOTE the plcRotationKey might not be exportable\n : await createRotationKey(),\n inviteRequired: false,\n disableSsrfProtection: true,\n serviceName: 'Development PDS',\n primaryColor: '#f0828d',\n errorColor: 'rgb(238, 0, 78)', // rgb() notation should work too\n logoUrl:\n // Using a \"data:\" instead of a real URL to avoid making CORS requests in dev.\n // License: https://uxwing.com/license/\n // Source: https://uxwing.com/bee-icon/\n `data:image/svg+xml;base64,${Buffer.from('<svg xmlns=\"http://www.w3.org/2000/svg\" shape-rendering=\"geometricPrecision\" text-rendering=\"geometricPrecision\" image-rendering=\"optimizeQuality\" fill-rule=\"evenodd\" clip-rule=\"evenodd\" viewBox=\"0 0 503 511.623\"><path fill=\"#FFB9B9\" d=\"M379.75 85.311l90.022 89.879C503.264 128.804 502.534 31.13 476.188 0c-27.441 31.966-59.103 60.767-96.438 85.311z\"/><path fill=\"#E2828D\" d=\"M399.445 104.976l70.327 70.214c26.443-36.622 31.549-105.205 19.563-147.778-26.692 28.309-56.413 54.344-89.89 77.564z\"/><path fill=\"#FFB9B9\" d=\"M119.595 85.311L29.573 175.19C-3.919 128.804-3.189 31.13 23.156 0c27.441 31.966 59.103 60.767 96.439 85.311z\"/><path fill=\"#E2828D\" d=\"M99.899 104.976L29.573 175.19C3.13 138.568-1.976 69.985 10.01 27.412c26.692 28.309 56.413 54.344 89.889 77.564z\"/><path fill=\"#FFB9B9\" d=\"M251.5 51.303c138.898 0 251.5 103.046 251.5 230.16 0 127.114-112.602 230.16-251.5 230.16C112.6 511.623 0 408.577 0 281.463c0-127.114 112.6-230.16 251.5-230.16z\"/><path fill=\"#331400\" d=\"M138.142 188.245c16.387 0 29.672 13.283 29.672 29.672 0 16.389-13.285 29.673-29.672 29.673-16.389 0-29.675-13.284-29.675-29.673 0-16.389 13.286-29.672 29.675-29.672zM360.695 188.245c16.389 0 29.674 13.283 29.674 29.672 0 16.389-13.285 29.673-29.674 29.673-16.387 0-29.673-13.284-29.673-29.673 0-16.389 13.286-29.672 29.673-29.672z\"/><path fill=\"#F0828D\" fill-rule=\"nonzero\" d=\"M251.5 255.548c37.407 0 71.438 11.136 96.213 29.138 25.886 18.808 41.905 45.125 41.905 74.487 0 29.36-16.017 55.679-41.908 74.49-24.772 18.001-58.805 29.138-96.21 29.138-37.405 0-71.438-11.137-96.21-29.138-25.891-18.811-41.908-45.13-41.908-74.49 0-29.362 16.019-55.679 41.905-74.487 24.775-18.002 58.808-29.138 96.213-29.138z\"/><circle fill=\"#A5414B\" cx=\"203.259\" cy=\"358.515\" r=\"29.673\"/><circle fill=\"#A5414B\" cx=\"298.744\" cy=\"358.515\" r=\"29.673\"/></svg>', 'utf8').toString('base64')}`,\n homeUrl: 'https://bsky.social/',\n termsOfServiceUrl: 'https://bsky.social/about/support/tos',\n privacyPolicyUrl: 'https://bsky.social/about/support/privacy-policy',\n supportUrl: 'https://blueskyweb.zendesk.com/hc/en-us',\n ...env,\n },\n overrides,\n )\n\n await server.start()\n\n return new TestPds(url, port, server)\n }\n\n get ctx(): AppContext {\n return this.server.ctx\n }\n\n getAgent(): AtpAgent {\n const agent = new AtpAgent({ service: this.url })\n agent.configureLabelers([EXAMPLE_LABELER])\n return agent\n }\n\n getClient(): Client {\n const client = new Client({ service: this.url })\n client.setLabelers([EXAMPLE_LABELER])\n return client\n }\n\n adminAuth(): string {\n return (\n 'Basic ' +\n ui8.toString(\n ui8.fromString(`admin:${ADMIN_PASSWORD}`, 'utf8'),\n 'base64pad',\n )\n )\n }\n\n adminAuthHeaders() {\n return {\n authorization: this.adminAuth(),\n }\n }\n\n jwtSecretKey() {\n return createSecretKeyObject(JWT_SECRET)\n }\n\n async processAll() {\n await this.ctx.backgroundQueue.processAll()\n }\n\n async close() {\n await this.server.destroy()\n }\n\n async [Symbol.asyncDispose]() {\n await this.close()\n }\n}\n\nasync function createRotationKey(): Promise<string> {\n const plcRotationKey = await Secp256k1Keypair.create({ exportable: true })\n const plcRotationPriv = await plcRotationKey.export()\n return Buffer.from(plcRotationPriv).toString('hex')\n}\n\nasync function mkTmpdir(): Promise<string> {\n const location = path.join(os.tmpdir(), randomStr(8, 'base32'))\n await fs.mkdir(location, { recursive: true })\n return location\n}\n"]}
1
+ {"version":3,"file":"pds.js","sourceRoot":"","sources":["../src/pds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAA;AACjC,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,KAAK,GAAG,MAAM,aAAa,CAAA;AAClC,OAAO,EAAE,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\nimport * as ui8 from 'uint8arrays'\nimport { AtpAgent } from '@atproto/api'\nimport { Secp256k1Keypair, randomStr } from '@atproto/crypto'\nimport { Client } from '@atproto/lex-client'\nimport type { UriString } from '@atproto/lex-schema'\nimport {\n type AppContext,\n type AppContextOptions,\n type KeyObject,\n PDS,\n createSecretKeyObject,\n} from '@atproto/pds'\nimport { ADMIN_PASSWORD, EXAMPLE_LABELER, JWT_SECRET } from './const.js'\nimport getPort from './get-port.js'\nimport type { PdsConfig } from './types.js'\n\n// Re-export types that are part of the public API\nexport { AtpAgent, Client, PDS }\nexport type { AppContextOptions, KeyObject, PdsConfig, UriString }\n\nexport class TestPds {\n constructor(\n public url: UriString,\n public port: number,\n public server: PDS,\n ) {}\n\n static async create(\n env: PdsConfig,\n overrides?: Partial<AppContextOptions>,\n ): Promise<TestPds> {\n const recoveryKey = (await Secp256k1Keypair.create()).did()\n\n const port = env.port || (await getPort())\n const url: UriString = `http://localhost:${port}`\n\n const server = await PDS.fromEnv(\n {\n devMode: true,\n port,\n dataDirectory: await mkTmpdir(),\n blobstoreDiskLocation: await mkTmpdir(),\n recoveryDidKey: recoveryKey,\n adminPassword: ADMIN_PASSWORD,\n jwtSecret: JWT_SECRET,\n // @NOTE \".example\" will not actually work and is only used to display\n // multiple domains in the sing-up UI\n serviceHandleDomains: ['.test', '.example'],\n bskyAppViewUrl: 'https://appview.invalid',\n bskyAppViewDid: 'did:example:invalid',\n bskyAppViewCdnUrlPattern: 'http://cdn.appview.com/%s/%s/%s',\n modServiceUrl: 'https://moderator.invalid',\n modServiceDid: 'did:example:invalid',\n plcRotationKeyK256PrivateKeyHex: overrides?.plcRotationKey\n ? undefined // @NOTE the plcRotationKey might not be exportable\n : await createRotationKey(),\n inviteRequired: false,\n disableSsrfProtection: true,\n serviceName: 'Development PDS',\n primaryColor: '#f0828d',\n errorColor: 'rgb(238, 0, 78)', // rgb() notation should work too\n logoUrl:\n // Using a \"data:\" instead of a real URL to avoid making CORS requests in dev.\n // License: https://uxwing.com/license/\n // Source: https://uxwing.com/bee-icon/\n `data:image/svg+xml;base64,${Buffer.from('<svg xmlns=\"http://www.w3.org/2000/svg\" shape-rendering=\"geometricPrecision\" text-rendering=\"geometricPrecision\" image-rendering=\"optimizeQuality\" fill-rule=\"evenodd\" clip-rule=\"evenodd\" viewBox=\"0 0 503 511.623\"><path fill=\"#FFB9B9\" d=\"M379.75 85.311l90.022 89.879C503.264 128.804 502.534 31.13 476.188 0c-27.441 31.966-59.103 60.767-96.438 85.311z\"/><path fill=\"#E2828D\" d=\"M399.445 104.976l70.327 70.214c26.443-36.622 31.549-105.205 19.563-147.778-26.692 28.309-56.413 54.344-89.89 77.564z\"/><path fill=\"#FFB9B9\" d=\"M119.595 85.311L29.573 175.19C-3.919 128.804-3.189 31.13 23.156 0c27.441 31.966 59.103 60.767 96.439 85.311z\"/><path fill=\"#E2828D\" d=\"M99.899 104.976L29.573 175.19C3.13 138.568-1.976 69.985 10.01 27.412c26.692 28.309 56.413 54.344 89.889 77.564z\"/><path fill=\"#FFB9B9\" d=\"M251.5 51.303c138.898 0 251.5 103.046 251.5 230.16 0 127.114-112.602 230.16-251.5 230.16C112.6 511.623 0 408.577 0 281.463c0-127.114 112.6-230.16 251.5-230.16z\"/><path fill=\"#331400\" d=\"M138.142 188.245c16.387 0 29.672 13.283 29.672 29.672 0 16.389-13.285 29.673-29.672 29.673-16.389 0-29.675-13.284-29.675-29.673 0-16.389 13.286-29.672 29.675-29.672zM360.695 188.245c16.389 0 29.674 13.283 29.674 29.672 0 16.389-13.285 29.673-29.674 29.673-16.387 0-29.673-13.284-29.673-29.673 0-16.389 13.286-29.672 29.673-29.672z\"/><path fill=\"#F0828D\" fill-rule=\"nonzero\" d=\"M251.5 255.548c37.407 0 71.438 11.136 96.213 29.138 25.886 18.808 41.905 45.125 41.905 74.487 0 29.36-16.017 55.679-41.908 74.49-24.772 18.001-58.805 29.138-96.21 29.138-37.405 0-71.438-11.137-96.21-29.138-25.891-18.811-41.908-45.13-41.908-74.49 0-29.362 16.019-55.679 41.905-74.487 24.775-18.002 58.808-29.138 96.213-29.138z\"/><circle fill=\"#A5414B\" cx=\"203.259\" cy=\"358.515\" r=\"29.673\"/><circle fill=\"#A5414B\" cx=\"298.744\" cy=\"358.515\" r=\"29.673\"/></svg>', 'utf8').toString('base64')}`,\n homeUrl: 'https://bsky.social/',\n termsOfServiceUrl: 'https://bsky.social/about/support/tos',\n privacyPolicyUrl: 'https://bsky.social/about/support/privacy-policy',\n supportUrl: 'https://blueskyweb.zendesk.com/hc/en-us',\n ...env,\n },\n overrides,\n )\n\n await server.start()\n\n return new TestPds(url, port, server)\n }\n\n get ctx(): AppContext {\n return this.server.ctx\n }\n\n getAgent(): AtpAgent {\n const agent = new AtpAgent({ service: this.url })\n agent.configureLabelers([EXAMPLE_LABELER])\n return agent\n }\n\n getClient(): Client {\n const client = new Client({ service: this.url })\n client.setLabelers([EXAMPLE_LABELER])\n return client\n }\n\n adminAuth(): string {\n return (\n 'Basic ' +\n ui8.toString(\n ui8.fromString(`admin:${ADMIN_PASSWORD}`, 'utf8'),\n 'base64pad',\n )\n )\n }\n\n adminAuthHeaders() {\n return {\n authorization: this.adminAuth(),\n }\n }\n\n jwtSecretKey() {\n return createSecretKeyObject(JWT_SECRET)\n }\n\n async processAll() {\n await this.ctx.backgroundQueue.processAll()\n }\n\n async close() {\n await this.server.destroy()\n }\n\n async [Symbol.asyncDispose]() {\n await this.close()\n }\n}\n\nasync function createRotationKey(): Promise<string> {\n const plcRotationKey = await Secp256k1Keypair.create({ exportable: true })\n const plcRotationPriv = await plcRotationKey.export()\n return Buffer.from(plcRotationPriv).toString('hex')\n}\n\nasync function mkTmpdir(): Promise<string> {\n const location = path.join(os.tmpdir(), randomStr(8, 'base32'))\n await fs.mkdir(location, { recursive: true })\n return location\n}\n"]}
@@ -1,6 +1,7 @@
1
1
  import { CID } from 'multiformats/cid';
2
2
  import type { $Typed, AppBskyActorProfile, AppBskyFeedLike, AppBskyFeedPost, AppBskyFeedRepost, AppBskyGraphBlock, AppBskyGraphFollow, AppBskyGraphList, AppBskyGraphVerification, AppBskyRichtextFacet, AtpAgent, ChatBskyConvoDefs, ComAtprotoAdminDefs, ComAtprotoModerationCreateReport, ComAtprotoRepoStrongRef } from '@atproto/api';
3
- import type { CidString, Client } from '@atproto/lex';
3
+ import type { Client } from '@atproto/lex-client';
4
+ import type { CidString } from '@atproto/lex-schema';
4
5
  import type { BlobRef } from '@atproto/lexicon';
5
6
  import { AtUri, type AtUriString, type DidString, type HandleString } from '@atproto/syntax';
6
7
  import type { TestNetworkNoAppView } from '../network-no-appview.js';
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/seed/client.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,KAAK,EACV,MAAM,EACN,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,wBAAwB,EACxB,oBAAoB,EACpB,QAAQ,EACR,iBAAiB,EACjB,mBAAmB,EACnB,gCAAgC,EAChC,uBAAuB,EACxB,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EACL,KAAK,EACL,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,YAAY,EAClB,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAepE,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,OAAO,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,qBAAa,SAAS;IACpB,GAAG,EAAE,KAAK,CAAA;IACV,GAAG,EAAE,GAAG,CAAA;IAER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C,UAAU,CAAC,EAAE,CAAC,CACpB,CAAA;QACD,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,CAAA;QAC7B,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACpD,OAAO,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAA;IACxC,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,EAAa,EAAE,OAAkB;QAC9C,MAAM,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAA;QACtD,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAA;QAChD,CAAC;QAED,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CACjD,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,CAAC,IAAI,EAAE,EACrC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CACpB,CAAA;QACD,OAAO,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAA;IACxC,CAAC;IAED,UAAU,CAAC,GAAc;QACvB,OAAO,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAA;IAC5D,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,GAAW;QAC3B,OAAO,EAAE,aAAa,EAAE,UAAU,GAAG,EAAE,EAAE,CAAA;IAC3C,CAAC;CACF","sourcesContent":["import fs from 'node:fs/promises'\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport { CID } from 'multiformats/cid'\nimport type {\n $Typed,\n AppBskyActorProfile,\n AppBskyFeedLike,\n AppBskyFeedPost,\n AppBskyFeedRepost,\n AppBskyGraphBlock,\n AppBskyGraphFollow,\n AppBskyGraphList,\n AppBskyGraphVerification,\n AppBskyRichtextFacet,\n AtpAgent,\n ChatBskyConvoDefs,\n ComAtprotoAdminDefs,\n ComAtprotoModerationCreateReport,\n ComAtprotoRepoStrongRef,\n} from '@atproto/api'\nimport type { CidString, Client } from '@atproto/lex'\nimport type { BlobRef } from '@atproto/lexicon'\nimport {\n AtUri,\n type AtUriString,\n type DidString,\n type HandleString,\n} from '@atproto/syntax'\nimport type { TestNetworkNoAppView } from '../network-no-appview.js'\n\n// Makes it simple to create data via the XRPC client,\n// and keeps track of all created data in memory for convenience.\n\nlet AVATAR_IMG: Uint8Array | undefined\n\n// AVATAR_PATH is defined in a non-CWD-dependant way, so this works\n// for any consumer of this package, even outside the atproto repo.\nconst __dirname = path.dirname(fileURLToPath(import.meta.url))\nconst AVATAR_PATH = path.resolve(\n __dirname,\n '../../assets/key-portrait-small.jpg',\n)\n\nexport type ImageRef = {\n image: BlobRef\n alt: string\n}\n\nexport class RecordRef {\n uri: AtUri\n cid: CID\n\n constructor(uri: AtUri | string, cid: CID | string) {\n this.uri = new AtUri(uri.toString())\n this.cid = CID.parse(cid.toString())\n }\n\n get raw(): { uri: AtUriString; cid: CidString } {\n return {\n uri: this.uri.toString(),\n cid: this.cid.toString(),\n }\n }\n\n get uriStr(): AtUriString {\n return this.uri.toString()\n }\n\n get cidStr(): CidString {\n return this.cid.toString()\n }\n}\n\nexport type Account = {\n did: DidString\n accessJwt: string\n refreshJwt: string\n handle: HandleString\n email: string\n password: string\n}\n\nexport class SeedClient<\n Network extends TestNetworkNoAppView = TestNetworkNoAppView,\n> {\n accounts: Record<DidString, Account>\n profiles: Record<\n DidString,\n {\n displayName: string\n description: string\n avatar: { cid: string; mimeType: string }\n joinedViaStarterPack: RecordRef | undefined\n ref: RecordRef\n }\n >\n follows: Record<DidString, Record<DidString, RecordRef>>\n blocks: Record<DidString, Record<DidString, RecordRef>>\n mutes: Record<DidString, Set<DidString>>\n posts: Record<\n DidString,\n { text: string; ref: RecordRef; images: ImageRef[]; quote?: RecordRef }[]\n >\n likes: Record<DidString, Record<string, AtUri>>\n replies: Record<\n string,\n { text: string; ref: RecordRef; images: ImageRef[] }[]\n >\n reposts: Record<DidString, RecordRef[]>\n lists: Record<\n DidString,\n Record<\n AtUriString,\n {\n ref: RecordRef\n items: Record<DidString, RecordRef>\n }\n >\n >\n feedgens: Record<\n DidString,\n Record<\n AtUriString,\n {\n ref: RecordRef\n items: Record<string, RecordRef>\n }\n >\n >\n starterpacks: Record<\n DidString,\n Record<\n AtUriString,\n {\n ref: RecordRef\n name: string\n list: RecordRef\n feeds: readonly AtUriString[]\n }\n >\n >\n\n verifications: Record<DidString, Record<DidString, AtUri>>\n\n dids: Record<string, DidString>\n\n constructor(\n public network: Network,\n public agent: AtpAgent,\n public client: Client,\n ) {\n this.accounts = {}\n this.profiles = {}\n this.follows = {}\n this.blocks = {}\n this.mutes = {}\n this.posts = {}\n this.likes = {}\n this.replies = {}\n this.reposts = {}\n this.lists = {}\n this.feedgens = {}\n this.starterpacks = {}\n this.verifications = {}\n this.dids = {}\n }\n\n async createAccount(\n shortName: string,\n params: {\n handle: HandleString\n email: string\n password: string\n inviteCode?: string\n },\n ): Promise<Account> {\n const { data: account } =\n await this.agent.com.atproto.server.createAccount(params)\n const did = account.did as DidString\n this.dids[shortName] = did\n this.accounts[account.did] = {\n // @NOTE type case needed until we move test to lex-sdk\n ...(account as typeof account & { handle: HandleString }),\n did,\n email: params.email,\n password: params.password,\n }\n return this.accounts[account.did]\n }\n\n async updateHandle(by: DidString, handle: HandleString) {\n await this.agent.com.atproto.identity.updateHandle(\n { handle },\n { encoding: 'application/json', headers: this.getHeaders(by) },\n )\n }\n\n async createProfile(\n by: DidString,\n displayName: string,\n description: string,\n selfLabels?: readonly string[],\n joinedViaStarterPack?: RecordRef,\n overrides?: Partial<AppBskyActorProfile.Record>,\n ): Promise<{\n displayName: string\n description: string\n avatar: { cid: string; mimeType: string }\n ref: RecordRef\n joinedViaStarterPack?: RecordRef\n }> {\n AVATAR_IMG ??= await fs.readFile(AVATAR_PATH)\n\n let avatarBlob\n {\n const res = await this.agent.com.atproto.repo.uploadBlob(AVATAR_IMG, {\n encoding: 'image/jpeg',\n headers: this.getHeaders(by),\n } as any)\n avatarBlob = res.data.blob\n }\n\n {\n const res = await this.agent.app.bsky.actor.profile.create(\n { repo: by },\n {\n displayName,\n description,\n avatar: avatarBlob,\n labels: selfLabels\n ? {\n $type: 'com.atproto.label.defs#selfLabels',\n values: selfLabels.map((val) => ({ val })),\n }\n : undefined,\n joinedViaStarterPack: joinedViaStarterPack?.raw,\n createdAt: new Date().toISOString(),\n ...overrides,\n },\n this.getHeaders(by),\n )\n this.profiles[by] = {\n displayName,\n description,\n avatar: avatarBlob,\n joinedViaStarterPack,\n ref: new RecordRef(res.uri, res.cid),\n }\n }\n return this.profiles[by]\n }\n\n async updateProfile(by: DidString, record: Record<string, unknown>) {\n const res = await this.agent.com.atproto.repo.putRecord(\n {\n repo: by,\n collection: 'app.bsky.actor.profile',\n rkey: 'self',\n record,\n },\n { headers: this.getHeaders(by), encoding: 'application/json' },\n )\n this.profiles[by] = {\n ...(this.profiles[by] ?? {}),\n ...record,\n ref: new RecordRef(res.data.uri, res.data.cid),\n }\n return this.profiles[by]\n }\n\n async follow(\n from: DidString,\n to: DidString,\n overrides?: Partial<AppBskyGraphFollow.Record>,\n ) {\n const res = await this.agent.app.bsky.graph.follow.create(\n { repo: from },\n {\n subject: to,\n createdAt: new Date().toISOString(),\n ...overrides,\n },\n this.getHeaders(from),\n )\n this.follows[from] ??= {}\n this.follows[from][to] = new RecordRef(res.uri, res.cid)\n return this.follows[from][to]\n }\n\n async unfollow(from: DidString, to: DidString) {\n const follow = this.follows[from][to]\n if (!follow) {\n throw new Error('follow does not exist')\n }\n await this.agent.app.bsky.graph.follow.delete(\n { repo: from, rkey: follow.uri.rkey },\n this.getHeaders(from),\n )\n delete this.follows[from][to]\n }\n\n async block(\n from: DidString,\n to: DidString,\n overrides?: Partial<AppBskyGraphBlock.Record>,\n ) {\n const res = await this.agent.app.bsky.graph.block.create(\n { repo: from },\n {\n subject: to,\n createdAt: new Date().toISOString(),\n ...overrides,\n },\n this.getHeaders(from),\n )\n this.blocks[from] ??= {}\n this.blocks[from][to] = new RecordRef(res.uri, res.cid)\n return this.blocks[from][to]\n }\n\n async unblock(from: DidString, to: DidString) {\n const block = this.blocks[from][to]\n if (!block) {\n throw new Error('block does not exist')\n }\n await this.agent.app.bsky.graph.block.delete(\n { repo: from, rkey: block.uri.rkey },\n this.getHeaders(from),\n )\n delete this.blocks[from][to]\n }\n\n async mute(from: DidString, to: DidString) {\n await this.agent.app.bsky.graph.muteActor(\n {\n actor: to,\n },\n { headers: this.getHeaders(from) },\n )\n this.mutes[from] ??= new Set()\n this.mutes[from].add(to)\n return this.mutes[from][to]\n }\n\n async post(\n by: DidString,\n text: string,\n facets?: AppBskyRichtextFacet.Main[],\n images?: ImageRef[],\n quote?: RecordRef,\n overrides?: Partial<AppBskyFeedPost.Record>,\n ) {\n const imageEmbed = images && {\n $type: 'app.bsky.embed.images',\n images,\n }\n const recordEmbed = quote && {\n record: { uri: quote.uriStr, cid: quote.cidStr },\n }\n const embed =\n imageEmbed && recordEmbed\n ? {\n $type: 'app.bsky.embed.recordWithMedia',\n record: recordEmbed,\n media: imageEmbed,\n }\n : recordEmbed\n ? { $type: 'app.bsky.embed.record', ...recordEmbed }\n : imageEmbed\n const res = await this.agent.app.bsky.feed.post.create(\n { repo: by },\n {\n text: text,\n facets,\n embed,\n createdAt: new Date().toISOString(),\n ...overrides,\n },\n this.getHeaders(by),\n )\n this.posts[by] ??= []\n const post = {\n text,\n ref: new RecordRef(res.uri, res.cid),\n images: images ?? [],\n quote,\n }\n this.posts[by].push(post)\n return post\n }\n\n async deletePost(by: DidString, uri: AtUri) {\n await this.agent.app.bsky.feed.post.delete(\n {\n repo: by,\n rkey: uri.rkey,\n },\n this.getHeaders(by),\n )\n }\n\n async uploadFile(\n by: DidString,\n filePath: string,\n encoding: string,\n ): Promise<ImageRef> {\n const file = await fs.readFile(filePath)\n const res = await this.agent.com.atproto.repo.uploadBlob(file, {\n headers: this.getHeaders(by),\n encoding,\n } as any)\n return { image: res.data.blob, alt: filePath }\n }\n\n async like(\n by: DidString,\n subject: RecordRef,\n overrides?: Partial<AppBskyFeedLike.Record>,\n ) {\n const res = await this.agent.app.bsky.feed.like.create(\n { repo: by },\n {\n subject: subject.raw,\n createdAt: new Date().toISOString(),\n ...overrides,\n },\n this.getHeaders(by),\n )\n this.likes[by] ??= {}\n this.likes[by][subject.uriStr] = new AtUri(res.uri)\n return this.likes[by][subject.uriStr]\n }\n\n async reply(\n by: DidString,\n root: RecordRef,\n parent: RecordRef,\n text: string,\n facets?: AppBskyRichtextFacet.Main[],\n images?: ImageRef[],\n overrides?: Partial<AppBskyFeedPost.Record>,\n ) {\n const embed = images\n ? {\n $type: 'app.bsky.embed.images',\n images,\n }\n : undefined\n const res = await this.agent.app.bsky.feed.post.create(\n { repo: by },\n {\n text: text,\n reply: {\n root: root.raw,\n parent: parent.raw,\n },\n facets,\n embed,\n createdAt: new Date().toISOString(),\n ...overrides,\n },\n this.getHeaders(by),\n )\n this.replies[by] ??= []\n const reply = {\n text,\n ref: new RecordRef(res.uri, res.cid),\n images: images ?? [],\n }\n this.replies[by].push(reply)\n return reply\n }\n\n async repost(\n by: DidString,\n subject: RecordRef,\n overrides?: Partial<AppBskyFeedRepost.Record>,\n ) {\n const res = await this.agent.app.bsky.feed.repost.create(\n { repo: by },\n {\n subject: subject.raw,\n createdAt: new Date().toISOString(),\n ...overrides,\n },\n this.getHeaders(by),\n )\n this.reposts[by] ??= []\n const repost = new RecordRef(res.uri, res.cid)\n this.reposts[by].push(repost)\n return repost\n }\n\n async createList(\n by: DidString,\n name: string,\n purpose: 'mod' | 'curate' | 'reference',\n overrides?: Partial<AppBskyGraphList.Record>,\n ) {\n const res = await this.agent.app.bsky.graph.list.create(\n { repo: by },\n {\n name,\n purpose:\n purpose === 'mod'\n ? 'app.bsky.graph.defs#modlist'\n : purpose === 'curate'\n ? 'app.bsky.graph.defs#curatelist'\n : 'app.bsky.graph.defs#referencelist',\n createdAt: new Date().toISOString(),\n ...(overrides || {}),\n },\n this.getHeaders(by),\n )\n this.lists[by] ??= {}\n const ref = new RecordRef(res.uri, res.cid)\n this.lists[by][ref.uriStr] = {\n ref: ref,\n items: {},\n }\n return ref\n }\n\n async createFeedGen(by: DidString, feedDid: string, name: string) {\n const res = await this.agent.app.bsky.feed.generator.create(\n { repo: by },\n {\n did: feedDid,\n displayName: name,\n createdAt: new Date().toISOString(),\n },\n this.getHeaders(by),\n )\n this.feedgens[by] ??= {}\n const ref = new RecordRef(res.uri, res.cid)\n this.feedgens[by][ref.uriStr] = {\n ref: ref,\n items: {},\n }\n return ref\n }\n\n async createStarterPack(\n by: DidString,\n name: string,\n actors: readonly DidString[],\n feeds?: readonly AtUriString[],\n ) {\n const list = await this.createList(by, 'n/a', 'reference')\n for (const did of actors) {\n await this.addToList(by, did, list)\n }\n const res = await this.agent.app.bsky.graph.starterpack.create(\n { repo: by },\n {\n name,\n list: list.uriStr,\n feeds: feeds?.map((uri) => ({ uri })),\n createdAt: new Date().toISOString(),\n },\n this.getHeaders(by),\n )\n this.starterpacks[by] ??= {}\n const ref = new RecordRef(res.uri, res.cid)\n this.starterpacks[by][ref.uriStr] = {\n ref: ref,\n list,\n feeds: feeds ?? [],\n name,\n }\n return ref\n }\n\n async addToList(by: DidString, subject: DidString, list: RecordRef) {\n const res = await this.agent.app.bsky.graph.listitem.create(\n { repo: by },\n { subject, list: list.uriStr, createdAt: new Date().toISOString() },\n this.getHeaders(by),\n )\n const ref = new RecordRef(res.uri, res.cid)\n const found = (this.lists[by] ?? {})[list.uriStr]\n if (found) {\n found.items[subject] = ref\n }\n return ref\n }\n\n async rmFromList(by: DidString, subject: DidString, list: RecordRef) {\n const foundList = (this.lists[by] ?? {})[list.uriStr] ?? {}\n if (!foundList) return\n const foundItem = foundList.items[subject]\n if (!foundItem) return\n await this.agent.app.bsky.graph.listitem.delete(\n { repo: by, rkey: foundItem.uri.rkey },\n this.getHeaders(by),\n )\n delete foundList.items[subject]\n }\n\n // override public signature to add support for convos and messages\n async createReport(opts: {\n reasonType: ComAtprotoModerationCreateReport.InputSchema['reasonType']\n subject:\n | $Typed<ComAtprotoAdminDefs.RepoRef>\n | $Typed<ComAtprotoRepoStrongRef.Main>\n | $Typed<ChatBskyConvoDefs.MessageRef>\n | $Typed<ChatBskyConvoDefs.ConvoRef>\n | { $type: string }\n reason?: string\n reportedBy: DidString\n }): Promise<\n ComAtprotoModerationCreateReport.OutputSchema & {\n subject:\n | $Typed<ComAtprotoAdminDefs.RepoRef>\n | $Typed<ComAtprotoRepoStrongRef.Main>\n | $Typed<ChatBskyConvoDefs.MessageRef>\n | $Typed<ChatBskyConvoDefs.ConvoRef>\n | { $type: string }\n }\n > {\n const { reasonType, subject, reason, reportedBy } = opts\n const result = await this.agent.com.atproto.moderation.createReport(\n { reasonType, subject, reason },\n {\n encoding: 'application/json',\n headers: this.getHeaders(reportedBy),\n },\n )\n return result.data\n }\n\n async verify(\n by: DidString,\n subject: DidString,\n handle: HandleString,\n displayName: string,\n overrides?: Partial<AppBskyGraphVerification.Record>,\n ) {\n const res = await this.agent.app.bsky.graph.verification.create(\n { repo: by },\n {\n subject,\n createdAt: new Date().toISOString(),\n handle,\n displayName,\n ...overrides,\n },\n this.getHeaders(by),\n )\n this.verifications[by] ??= {}\n this.verifications[by][subject] = new AtUri(res.uri)\n return this.verifications[by][subject]\n }\n\n async unverify(by: DidString, subject: DidString) {\n const verification = this.verifications[by]?.[subject]\n if (!verification) {\n throw new Error('verification does not exist')\n }\n\n await this.agent.app.bsky.graph.verification.delete(\n { repo: by, rkey: verification.rkey },\n this.getHeaders(by),\n )\n delete this.verifications[by][subject]\n }\n\n getHeaders(did: DidString) {\n return SeedClient.getHeaders(this.accounts[did].accessJwt)\n }\n\n static getHeaders(jwt: string) {\n return { authorization: `Bearer ${jwt}` }\n }\n}\n"]}
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/seed/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAA;AACjC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAqBtC,OAAO,EACL,KAAK,GAIN,MAAM,iBAAiB,CAAA;AAGxB,sDAAsD;AACtD,iEAAiE;AAEjE,IAAI,UAAkC,CAAA;AAEtC,mEAAmE;AACnE,mEAAmE;AACnE,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;AAC9D,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAC9B,SAAS,EACT,qCAAqC,CACtC,CAAA;AAOD,MAAM,OAAO,SAAS;IAIpB,YAAY,GAAmB,EAAE,GAAiB;QAChD,IAAI,CAAC,GAAG,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAA;QACpC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAA;IACtC,CAAC;IAED,IAAI,GAAG;QACL,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE;YACxB,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE;SACzB,CAAA;IACH,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAA;IAC5B,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAA;IAC5B,CAAC;CACF;AAW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IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAA;QAChD,CAAC;QAED,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CACjD,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,CAAC,IAAI,EAAE,EACrC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CACpB,CAAA;QACD,OAAO,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAA;IACxC,CAAC;IAED,UAAU,CAAC,GAAc;QACvB,OAAO,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAA;IAC5D,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,GAAW;QAC3B,OAAO,EAAE,aAAa,EAAE,UAAU,GAAG,EAAE,EAAE,CAAA;IAC3C,CAAC;CACF","sourcesContent":["import fs from 'node:fs/promises'\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport { CID } from 'multiformats/cid'\nimport type {\n $Typed,\n AppBskyActorProfile,\n AppBskyFeedLike,\n AppBskyFeedPost,\n AppBskyFeedRepost,\n AppBskyGraphBlock,\n AppBskyGraphFollow,\n AppBskyGraphList,\n AppBskyGraphVerification,\n AppBskyRichtextFacet,\n AtpAgent,\n ChatBskyConvoDefs,\n ComAtprotoAdminDefs,\n ComAtprotoModerationCreateReport,\n ComAtprotoRepoStrongRef,\n} from '@atproto/api'\nimport type { Client } from '@atproto/lex-client'\nimport type { CidString } from '@atproto/lex-schema'\nimport type { BlobRef } from '@atproto/lexicon'\nimport {\n AtUri,\n type AtUriString,\n type DidString,\n type HandleString,\n} from '@atproto/syntax'\nimport type { TestNetworkNoAppView } from '../network-no-appview.js'\n\n// Makes it simple to create data via the XRPC client,\n// and keeps track of all created data in memory for convenience.\n\nlet AVATAR_IMG: Uint8Array | undefined\n\n// AVATAR_PATH is defined in a non-CWD-dependant way, so this works\n// for any consumer of this package, even outside the atproto repo.\nconst __dirname = path.dirname(fileURLToPath(import.meta.url))\nconst AVATAR_PATH = path.resolve(\n __dirname,\n '../../assets/key-portrait-small.jpg',\n)\n\nexport type ImageRef = {\n image: BlobRef\n alt: string\n}\n\nexport class RecordRef {\n uri: AtUri\n cid: CID\n\n constructor(uri: AtUri | string, cid: CID | string) {\n this.uri = new AtUri(uri.toString())\n this.cid = CID.parse(cid.toString())\n }\n\n get raw(): { uri: AtUriString; cid: CidString } {\n return {\n uri: this.uri.toString(),\n cid: this.cid.toString(),\n }\n }\n\n get uriStr(): AtUriString {\n return this.uri.toString()\n }\n\n get cidStr(): CidString {\n return this.cid.toString()\n }\n}\n\nexport type Account = {\n did: DidString\n accessJwt: string\n refreshJwt: string\n handle: HandleString\n email: string\n password: string\n}\n\nexport class SeedClient<\n Network extends TestNetworkNoAppView = TestNetworkNoAppView,\n> {\n accounts: Record<DidString, Account>\n profiles: Record<\n DidString,\n {\n displayName: string\n description: string\n avatar: { cid: string; mimeType: string }\n joinedViaStarterPack: RecordRef | undefined\n ref: RecordRef\n }\n >\n follows: Record<DidString, Record<DidString, RecordRef>>\n blocks: Record<DidString, Record<DidString, RecordRef>>\n mutes: Record<DidString, Set<DidString>>\n posts: Record<\n DidString,\n { text: string; ref: RecordRef; images: ImageRef[]; quote?: RecordRef }[]\n >\n likes: Record<DidString, Record<string, AtUri>>\n replies: Record<\n string,\n { text: string; ref: RecordRef; images: ImageRef[] }[]\n >\n reposts: Record<DidString, RecordRef[]>\n lists: Record<\n DidString,\n Record<\n AtUriString,\n {\n ref: RecordRef\n items: Record<DidString, RecordRef>\n }\n >\n >\n feedgens: Record<\n DidString,\n Record<\n AtUriString,\n {\n ref: RecordRef\n items: Record<string, RecordRef>\n }\n >\n >\n starterpacks: Record<\n DidString,\n Record<\n AtUriString,\n {\n ref: RecordRef\n name: string\n list: RecordRef\n feeds: readonly AtUriString[]\n }\n >\n >\n\n verifications: Record<DidString, Record<DidString, AtUri>>\n\n dids: Record<string, DidString>\n\n constructor(\n public network: Network,\n public agent: AtpAgent,\n public client: Client,\n ) {\n this.accounts = {}\n this.profiles = {}\n this.follows = {}\n this.blocks = {}\n this.mutes = {}\n this.posts = {}\n this.likes = {}\n this.replies = {}\n this.reposts = {}\n this.lists = {}\n this.feedgens = {}\n this.starterpacks = {}\n this.verifications = {}\n this.dids = {}\n }\n\n async createAccount(\n shortName: string,\n params: {\n handle: HandleString\n email: string\n password: string\n inviteCode?: string\n },\n ): Promise<Account> {\n const { data: account } =\n await this.agent.com.atproto.server.createAccount(params)\n const did = account.did as DidString\n this.dids[shortName] = did\n this.accounts[account.did] = {\n // @NOTE type case needed until we move test to lex-sdk\n ...(account as typeof account & { handle: HandleString }),\n did,\n email: params.email,\n password: params.password,\n }\n return this.accounts[account.did]\n }\n\n async updateHandle(by: DidString, handle: HandleString) {\n await this.agent.com.atproto.identity.updateHandle(\n { handle },\n { encoding: 'application/json', headers: this.getHeaders(by) },\n )\n }\n\n async createProfile(\n by: DidString,\n displayName: string,\n description: string,\n selfLabels?: readonly string[],\n joinedViaStarterPack?: RecordRef,\n overrides?: Partial<AppBskyActorProfile.Record>,\n ): Promise<{\n displayName: string\n description: string\n avatar: { cid: string; mimeType: string }\n ref: RecordRef\n joinedViaStarterPack?: RecordRef\n }> {\n AVATAR_IMG ??= await fs.readFile(AVATAR_PATH)\n\n let avatarBlob\n {\n const res = await this.agent.com.atproto.repo.uploadBlob(AVATAR_IMG, {\n encoding: 'image/jpeg',\n headers: this.getHeaders(by),\n } as any)\n avatarBlob = res.data.blob\n }\n\n {\n const res = await this.agent.app.bsky.actor.profile.create(\n { repo: by },\n {\n displayName,\n description,\n avatar: avatarBlob,\n labels: selfLabels\n ? {\n $type: 'com.atproto.label.defs#selfLabels',\n values: selfLabels.map((val) => ({ val })),\n }\n : undefined,\n joinedViaStarterPack: joinedViaStarterPack?.raw,\n createdAt: new Date().toISOString(),\n ...overrides,\n },\n this.getHeaders(by),\n )\n this.profiles[by] = {\n displayName,\n description,\n avatar: avatarBlob,\n joinedViaStarterPack,\n ref: new RecordRef(res.uri, res.cid),\n }\n }\n return this.profiles[by]\n }\n\n async updateProfile(by: DidString, record: Record<string, unknown>) {\n const res = await this.agent.com.atproto.repo.putRecord(\n {\n repo: by,\n collection: 'app.bsky.actor.profile',\n rkey: 'self',\n record,\n },\n { headers: this.getHeaders(by), encoding: 'application/json' },\n )\n this.profiles[by] = {\n ...(this.profiles[by] ?? {}),\n ...record,\n ref: new RecordRef(res.data.uri, res.data.cid),\n }\n return this.profiles[by]\n }\n\n async follow(\n from: DidString,\n to: DidString,\n overrides?: Partial<AppBskyGraphFollow.Record>,\n ) {\n const res = await this.agent.app.bsky.graph.follow.create(\n { repo: from },\n {\n subject: to,\n createdAt: new Date().toISOString(),\n ...overrides,\n },\n this.getHeaders(from),\n )\n this.follows[from] ??= {}\n this.follows[from][to] = new RecordRef(res.uri, res.cid)\n return this.follows[from][to]\n }\n\n async unfollow(from: DidString, to: DidString) {\n const follow = this.follows[from][to]\n if (!follow) {\n throw new Error('follow does not exist')\n }\n await this.agent.app.bsky.graph.follow.delete(\n { repo: from, rkey: follow.uri.rkey },\n this.getHeaders(from),\n )\n delete this.follows[from][to]\n }\n\n async block(\n from: DidString,\n to: DidString,\n overrides?: Partial<AppBskyGraphBlock.Record>,\n ) {\n const res = await this.agent.app.bsky.graph.block.create(\n { repo: from },\n {\n subject: to,\n createdAt: new Date().toISOString(),\n ...overrides,\n },\n this.getHeaders(from),\n )\n this.blocks[from] ??= {}\n this.blocks[from][to] = new RecordRef(res.uri, res.cid)\n return this.blocks[from][to]\n }\n\n async unblock(from: DidString, to: DidString) {\n const block = this.blocks[from][to]\n if (!block) {\n throw new Error('block does not exist')\n }\n await this.agent.app.bsky.graph.block.delete(\n { repo: from, rkey: block.uri.rkey },\n this.getHeaders(from),\n )\n delete this.blocks[from][to]\n }\n\n async mute(from: DidString, to: DidString) {\n await this.agent.app.bsky.graph.muteActor(\n {\n actor: to,\n },\n { headers: this.getHeaders(from) },\n )\n this.mutes[from] ??= new Set()\n this.mutes[from].add(to)\n return this.mutes[from][to]\n }\n\n async post(\n by: DidString,\n text: string,\n facets?: AppBskyRichtextFacet.Main[],\n images?: ImageRef[],\n quote?: RecordRef,\n overrides?: Partial<AppBskyFeedPost.Record>,\n ) {\n const imageEmbed = images && {\n $type: 'app.bsky.embed.images',\n images,\n }\n const recordEmbed = quote && {\n record: { uri: quote.uriStr, cid: quote.cidStr },\n }\n const embed =\n imageEmbed && recordEmbed\n ? {\n $type: 'app.bsky.embed.recordWithMedia',\n record: recordEmbed,\n media: imageEmbed,\n }\n : recordEmbed\n ? { $type: 'app.bsky.embed.record', ...recordEmbed }\n : imageEmbed\n const res = await this.agent.app.bsky.feed.post.create(\n { repo: by },\n {\n text: text,\n facets,\n embed,\n createdAt: new Date().toISOString(),\n ...overrides,\n },\n this.getHeaders(by),\n )\n this.posts[by] ??= []\n const post = {\n text,\n ref: new RecordRef(res.uri, res.cid),\n images: images ?? [],\n quote,\n }\n this.posts[by].push(post)\n return post\n }\n\n async deletePost(by: DidString, uri: AtUri) {\n await this.agent.app.bsky.feed.post.delete(\n {\n repo: by,\n rkey: uri.rkey,\n },\n this.getHeaders(by),\n )\n }\n\n async uploadFile(\n by: DidString,\n filePath: string,\n encoding: string,\n ): Promise<ImageRef> {\n const file = await fs.readFile(filePath)\n const res = await this.agent.com.atproto.repo.uploadBlob(file, {\n headers: this.getHeaders(by),\n encoding,\n } as any)\n return { image: res.data.blob, alt: filePath }\n }\n\n async like(\n by: DidString,\n subject: RecordRef,\n overrides?: Partial<AppBskyFeedLike.Record>,\n ) {\n const res = await this.agent.app.bsky.feed.like.create(\n { repo: by },\n {\n subject: subject.raw,\n createdAt: new Date().toISOString(),\n ...overrides,\n },\n this.getHeaders(by),\n )\n this.likes[by] ??= {}\n this.likes[by][subject.uriStr] = new AtUri(res.uri)\n return this.likes[by][subject.uriStr]\n }\n\n async reply(\n by: DidString,\n root: RecordRef,\n parent: RecordRef,\n text: string,\n facets?: AppBskyRichtextFacet.Main[],\n images?: ImageRef[],\n overrides?: Partial<AppBskyFeedPost.Record>,\n ) {\n const embed = images\n ? {\n $type: 'app.bsky.embed.images',\n images,\n }\n : undefined\n const res = await this.agent.app.bsky.feed.post.create(\n { repo: by },\n {\n text: text,\n reply: {\n root: root.raw,\n parent: parent.raw,\n },\n facets,\n embed,\n createdAt: new Date().toISOString(),\n ...overrides,\n },\n this.getHeaders(by),\n )\n this.replies[by] ??= []\n const reply = {\n text,\n ref: new RecordRef(res.uri, res.cid),\n images: images ?? [],\n }\n this.replies[by].push(reply)\n return reply\n }\n\n async repost(\n by: DidString,\n subject: RecordRef,\n overrides?: Partial<AppBskyFeedRepost.Record>,\n ) {\n const res = await this.agent.app.bsky.feed.repost.create(\n { repo: by },\n {\n subject: subject.raw,\n createdAt: new Date().toISOString(),\n ...overrides,\n },\n this.getHeaders(by),\n )\n this.reposts[by] ??= []\n const repost = new RecordRef(res.uri, res.cid)\n this.reposts[by].push(repost)\n return repost\n }\n\n async createList(\n by: DidString,\n name: string,\n purpose: 'mod' | 'curate' | 'reference',\n overrides?: Partial<AppBskyGraphList.Record>,\n ) {\n const res = await this.agent.app.bsky.graph.list.create(\n { repo: by },\n {\n name,\n purpose:\n purpose === 'mod'\n ? 'app.bsky.graph.defs#modlist'\n : purpose === 'curate'\n ? 'app.bsky.graph.defs#curatelist'\n : 'app.bsky.graph.defs#referencelist',\n createdAt: new Date().toISOString(),\n ...(overrides || {}),\n },\n this.getHeaders(by),\n )\n this.lists[by] ??= {}\n const ref = new RecordRef(res.uri, res.cid)\n this.lists[by][ref.uriStr] = {\n ref: ref,\n items: {},\n }\n return ref\n }\n\n async createFeedGen(by: DidString, feedDid: string, name: string) {\n const res = await this.agent.app.bsky.feed.generator.create(\n { repo: by },\n {\n did: feedDid,\n displayName: name,\n createdAt: new Date().toISOString(),\n },\n this.getHeaders(by),\n )\n this.feedgens[by] ??= {}\n const ref = new RecordRef(res.uri, res.cid)\n this.feedgens[by][ref.uriStr] = {\n ref: ref,\n items: {},\n }\n return ref\n }\n\n async createStarterPack(\n by: DidString,\n name: string,\n actors: readonly DidString[],\n feeds?: readonly AtUriString[],\n ) {\n const list = await this.createList(by, 'n/a', 'reference')\n for (const did of actors) {\n await this.addToList(by, did, list)\n }\n const res = await this.agent.app.bsky.graph.starterpack.create(\n { repo: by },\n {\n name,\n list: list.uriStr,\n feeds: feeds?.map((uri) => ({ uri })),\n createdAt: new Date().toISOString(),\n },\n this.getHeaders(by),\n )\n this.starterpacks[by] ??= {}\n const ref = new RecordRef(res.uri, res.cid)\n this.starterpacks[by][ref.uriStr] = {\n ref: ref,\n list,\n feeds: feeds ?? [],\n name,\n }\n return ref\n }\n\n async addToList(by: DidString, subject: DidString, list: RecordRef) {\n const res = await this.agent.app.bsky.graph.listitem.create(\n { repo: by },\n { subject, list: list.uriStr, createdAt: new Date().toISOString() },\n this.getHeaders(by),\n )\n const ref = new RecordRef(res.uri, res.cid)\n const found = (this.lists[by] ?? {})[list.uriStr]\n if (found) {\n found.items[subject] = ref\n }\n return ref\n }\n\n async rmFromList(by: DidString, subject: DidString, list: RecordRef) {\n const foundList = (this.lists[by] ?? {})[list.uriStr] ?? {}\n if (!foundList) return\n const foundItem = foundList.items[subject]\n if (!foundItem) return\n await this.agent.app.bsky.graph.listitem.delete(\n { repo: by, rkey: foundItem.uri.rkey },\n this.getHeaders(by),\n )\n delete foundList.items[subject]\n }\n\n // override public signature to add support for convos and messages\n async createReport(opts: {\n reasonType: ComAtprotoModerationCreateReport.InputSchema['reasonType']\n subject:\n | $Typed<ComAtprotoAdminDefs.RepoRef>\n | $Typed<ComAtprotoRepoStrongRef.Main>\n | $Typed<ChatBskyConvoDefs.MessageRef>\n | $Typed<ChatBskyConvoDefs.ConvoRef>\n | { $type: string }\n reason?: string\n reportedBy: DidString\n }): Promise<\n ComAtprotoModerationCreateReport.OutputSchema & {\n subject:\n | $Typed<ComAtprotoAdminDefs.RepoRef>\n | $Typed<ComAtprotoRepoStrongRef.Main>\n | $Typed<ChatBskyConvoDefs.MessageRef>\n | $Typed<ChatBskyConvoDefs.ConvoRef>\n | { $type: string }\n }\n > {\n const { reasonType, subject, reason, reportedBy } = opts\n const result = await this.agent.com.atproto.moderation.createReport(\n { reasonType, subject, reason },\n {\n encoding: 'application/json',\n headers: this.getHeaders(reportedBy),\n },\n )\n return result.data\n }\n\n async verify(\n by: DidString,\n subject: DidString,\n handle: HandleString,\n displayName: string,\n overrides?: Partial<AppBskyGraphVerification.Record>,\n ) {\n const res = await this.agent.app.bsky.graph.verification.create(\n { repo: by },\n {\n subject,\n createdAt: new Date().toISOString(),\n handle,\n displayName,\n ...overrides,\n },\n this.getHeaders(by),\n )\n this.verifications[by] ??= {}\n this.verifications[by][subject] = new AtUri(res.uri)\n return this.verifications[by][subject]\n }\n\n async unverify(by: DidString, subject: DidString) {\n const verification = this.verifications[by]?.[subject]\n if (!verification) {\n throw new Error('verification does not exist')\n }\n\n await this.agent.app.bsky.graph.verification.delete(\n { repo: by, rkey: verification.rkey },\n this.getHeaders(by),\n )\n delete this.verifications[by][subject]\n }\n\n getHeaders(did: DidString) {\n return SeedClient.getHeaders(this.accounts[did].accessJwt)\n }\n\n static getHeaders(jwt: string) {\n return { authorization: `Bearer ${jwt}` }\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { AtpAgent } from '@atproto/api';
2
- import type { DidString } from '@atproto/lex';
2
+ import type { DidString } from '@atproto/lex-schema';
3
3
  import type { TestPds } from './pds.js';
4
4
  export type ServiceUserDetails = {
5
5
  email: string;
@@ -1 +1 @@
1
- {"version":3,"file":"service-profile.d.ts","sourceRoot":"","sources":["../src/service-profile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,K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AG,oBAAoB,CAAC,IAAI,EAAE,KAAK,EAAE,CAAA;QAClD,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,QAAQ,KAAK,EAAE,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;QACrD,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,mBAAmB,KAAK,EAAE,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAA;QAE3E,MAAM,kBAAkB,GACtB,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAA;QAE5D,MAAM,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC;YACrD,SAAS,EAAE,kBAAkB,CAAC,IAAI,CAAC,SAAS;SAC7C,CAAC,CAAA;QAEF,MAAM,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,CAAA;QAEnD,IAAI,CAAC,GAAG,GAAG,MAAM,CAAA;QACjB,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAA;IACvB,CAAC;CACF","sourcesContent":["import type { AtpAgent } from '@atproto/api'\nimport type { DidString } from '@atproto/lex'\nimport type { TestPds } from './pds.js'\n\nexport type ServiceUserDetails = {\n email: string\n handle: string\n password: string\n}\n\nexport type ServiceMigrationOptions = {\n services?: Record<string, unknown>\n verificationMethods?: Record<string, unknown>\n}\n\nexport class ServiceProfile {\n protected constructor(\n protected pds: TestPds,\n /** @note assumes the session is already authenticated */\n protected agent: AtpAgent,\n protected userDetails: ServiceUserDetails,\n ) {}\n\n get did(): DidString {\n return this.agent.assertDid\n }\n\n async migrateTo(newPds: TestPds, options: ServiceMigrationOptions = {}) {\n const newAgent = newPds.getAgent()\n\n const newPdsDesc = await newAgent.com.atproto.server.describeServer()\n const serviceAuth = await this.agent.com.atproto.server.getServiceAuth({\n aud: newPdsDesc.data.did,\n lxm: 'com.atproto.server.createAccount',\n })\n\n const inviteCode = newPds.ctx.cfg.invites.required\n ? await newAgent.com.atproto.server\n .createInviteCode(\n { useCount: 1 },\n {\n encoding: 'application/json',\n headers: newPds.adminAuthHeaders(),\n },\n )\n .then((res) => res.data.code)\n : undefined\n\n await newAgent.createAccount(\n {\n ...this.userDetails,\n inviteCode,\n did: this.did,\n },\n {\n encoding: 'application/json',\n headers: { authorization: `Bearer ${serviceAuth.data.token}` },\n },\n )\n\n // The session manager will use the \"didDoc\" in the result of\n // \"createAccount\" in order to setup the pdsUrl. However, since are in the\n // process of migrating, that didDoc references the old PDS. In order to\n // avoid calling the old PDS, let's clear the pdsUrl, which will result in\n // the (new) serviceUrl being used.\n newAgent.sessionManager.pdsUrl = undefined\n\n const newDidCredentialsRes =\n await newAgent.com.atproto.identity.getRecommendedDidCredentials()\n\n await this.agent.com.atproto.identity.requestPlcOperationSignature()\n const { token } = await this.pds.ctx.accountManager.db.db\n .selectFrom('email_token')\n .select('token')\n .where('did', '=', this.did)\n .where('purpose', '=', 'plc_operation')\n .executeTakeFirstOrThrow()\n\n const op = { ...newDidCredentialsRes.data, token }\n Object.assign((op.services ??= {}), options.services)\n Object.assign((op.verificationMethods ??= {}), options.verificationMethods)\n\n const signedPlcOperation =\n await this.agent.com.atproto.identity.signPlcOperation(op)\n\n await newAgent.com.atproto.identity.submitPlcOperation({\n operation: signedPlcOperation.data.operation,\n })\n\n await newAgent.com.atproto.server.activateAccount()\n\n this.pds = newPds\n this.agent = newAgent\n }\n}\n"]}
1
+ {"version":3,"file":"service-profile.js","sourceRoot":"","sources":["../src/service-profile.ts"],"names":[],"mappings":"AAeA,MAAM,OAAO,cAAc;IACzB,YACY,GAAY;IACtB,yDAAyD;IAC/C,KAAe,EACf,WAA+B;mBAH/B,GAAG;qBAEH,KAAK;2BACL,WAAW;IACpB,CAAC;IAEJ,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAA;IAC7B,CAAC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B,CAAC;CACF","sourcesContent":["import type { AtpAgent } from '@atproto/api'\nimport type { DidString } from '@atproto/lex-schema'\nimport type { TestPds } from './pds.js'\n\nexport type ServiceUserDetails = {\n email: string\n handle: string\n password: string\n}\n\nexport type ServiceMigrationOptions = {\n services?: Record<string, unknown>\n verificationMethods?: Record<string, unknown>\n}\n\nexport class ServiceProfile {\n protected constructor(\n protected pds: TestPds,\n /** @note assumes the session is already authenticated */\n protected agent: AtpAgent,\n protected userDetails: ServiceUserDetails,\n ) {}\n\n get did(): DidString {\n return this.agent.assertDid\n }\n\n async migrateTo(newPds: TestPds, options: ServiceMigrationOptions = {}) {\n const newAgent = newPds.getAgent()\n\n const newPdsDesc = await newAgent.com.atproto.server.describeServer()\n const serviceAuth = await this.agent.com.atproto.server.getServiceAuth({\n aud: newPdsDesc.data.did,\n lxm: 'com.atproto.server.createAccount',\n })\n\n const inviteCode = newPds.ctx.cfg.invites.required\n ? await newAgent.com.atproto.server\n .createInviteCode(\n { useCount: 1 },\n {\n encoding: 'application/json',\n headers: newPds.adminAuthHeaders(),\n },\n )\n .then((res) => res.data.code)\n : undefined\n\n await newAgent.createAccount(\n {\n ...this.userDetails,\n inviteCode,\n did: this.did,\n },\n {\n encoding: 'application/json',\n headers: { authorization: `Bearer ${serviceAuth.data.token}` },\n },\n )\n\n // The session manager will use the \"didDoc\" in the result of\n // \"createAccount\" in order to setup the pdsUrl. However, since are in the\n // process of migrating, that didDoc references the old PDS. In order to\n // avoid calling the old PDS, let's clear the pdsUrl, which will result in\n // the (new) serviceUrl being used.\n newAgent.sessionManager.pdsUrl = undefined\n\n const newDidCredentialsRes =\n await newAgent.com.atproto.identity.getRecommendedDidCredentials()\n\n await this.agent.com.atproto.identity.requestPlcOperationSignature()\n const { token } = await this.pds.ctx.accountManager.db.db\n .selectFrom('email_token')\n .select('token')\n .where('did', '=', this.did)\n .where('purpose', '=', 'plc_operation')\n .executeTakeFirstOrThrow()\n\n const op = { ...newDidCredentialsRes.data, token }\n Object.assign((op.services ??= {}), options.services)\n Object.assign((op.verificationMethods ??= {}), options.verificationMethods)\n\n const signedPlcOperation =\n await this.agent.com.atproto.identity.signPlcOperation(op)\n\n await newAgent.com.atproto.identity.submitPlcOperation({\n operation: signedPlcOperation.data.operation,\n })\n\n await newAgent.com.atproto.server.activateAccount()\n\n this.pds = newPds\n this.agent = newAgent\n }\n}\n"]}
package/dist/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type * as bsky from '@atproto/bsky';
2
2
  import type * as bsync from '@atproto/bsync';
3
3
  import type { ExportableKeypair, Keypair } from '@atproto/crypto';
4
- import type { DidString } from '@atproto/lex';
4
+ import type { DidString } from '@atproto/lex-schema';
5
5
  import type * as ozone from '@atproto/ozone';
6
6
  import type * as pds from '@atproto/pds';
7
7
  export type IntrospectConfig = {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,eAAe,CAAA;AAC1C,OAAO,KAAK,KAAK,KAAK,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,KAAK,KAAK,KAAK,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,KAAK,GAAG,MAAM,cAAc,CAAA;AAExC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,GAAG;IACvD,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EA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MAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,iBAAiB,CAAC,GAAG;IAC3D,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG;IAC1D,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,iBAAiB,CAAA;IAC9B,cAAc,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAA;IACvC,gBAAgB,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAA;CAC1C,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,aAAa,EAAE,MAAM,CAAA;IACrB,gBAAgB,EAAE,MAAM,CAAA;IACxB,GAAG,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;IACvB,GAAG,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;IACvB,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,CAAA;IACzB,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;IAC3B,UAAU,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAA;CACtC,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,GAAG,EAAE,SAAS,CAAA;IACd,GAAG,EAAE,OAAO,CAAA;CACb,CAAA"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type * as bsky from '@atproto/bsky'\nimport type * as bsync from '@atproto/bsync'\nimport type { ExportableKeypair, Keypair } from '@atproto/crypto'\nimport type { DidString } from '@atproto/lex'\nimport type * as ozone from '@atproto/ozone'\nimport type * as pds from '@atproto/pds'\n\nexport type IntrospectConfig = {\n port?: number\n}\n\nexport type PlcConfig = {\n port?: number\n version?: string\n}\n\nexport type PdsConfig = Partial<pds.ServerEnvironment> & {\n didPlcUrl: string\n migration?: string\n}\n\nexport type BskyConfig = Partial<bsky.ServerConfig> & {\n bsyncUrl: string\n plcUrl: string\n repoProvider: string\n dbPostgresUrl: string\n dbPostgresSchema: string\n redisHost: string\n pdsPort: number\n migration?: string\n privateKey?: string\n}\n\nexport type BsyncConfig = Partial<bsync.ServerEnvironment> & {\n dbUrl: string\n}\n\nexport type OzoneConfig = Partial<ozone.OzoneEnvironment> & {\n plcUrl: string\n appviewUrl: string\n appviewDid: string\n dbPostgresUrl: string\n migration?: string\n signingKey?: ExportableKeypair\n imgInvalidator?: ozone.ImageInvalidator\n videoInvalidator?: ozone.VideoInvalidator\n}\n\nexport type TestServerParams = {\n dbPostgresUrl: string\n dbPostgresSchema: string\n pds: Partial<PdsConfig>\n plc: Partial<PlcConfig>\n bsky: Partial<BskyConfig>\n ozone: Partial<OzoneConfig>\n introspect: Partial<IntrospectConfig>\n}\n\nexport type DidAndKey = {\n did: DidString\n key: Keypair\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type * as bsky from '@atproto/bsky'\nimport type * as bsync from '@atproto/bsync'\nimport type { ExportableKeypair, Keypair } from '@atproto/crypto'\nimport type { DidString } from '@atproto/lex-schema'\nimport type * as ozone from '@atproto/ozone'\nimport type * as pds from '@atproto/pds'\n\nexport type IntrospectConfig = {\n port?: number\n}\n\nexport type PlcConfig = {\n port?: number\n version?: string\n}\n\nexport type PdsConfig = Partial<pds.ServerEnvironment> & {\n didPlcUrl: string\n migration?: string\n}\n\nexport type BskyConfig = Partial<bsky.ServerConfig> & {\n bsyncUrl: string\n plcUrl: string\n repoProvider: string\n dbPostgresUrl: string\n dbPostgresSchema: string\n redisHost: string\n pdsPort: number\n migration?: string\n privateKey?: string\n}\n\nexport type BsyncConfig = Partial<bsync.ServerEnvironment> & {\n dbUrl: string\n}\n\nexport type OzoneConfig = Partial<ozone.OzoneEnvironment> & {\n plcUrl: string\n appviewUrl: string\n appviewDid: string\n dbPostgresUrl: string\n migration?: string\n signingKey?: ExportableKeypair\n imgInvalidator?: ozone.ImageInvalidator\n videoInvalidator?: ozone.VideoInvalidator\n}\n\nexport type TestServerParams = {\n dbPostgresUrl: string\n dbPostgresSchema: string\n pds: Partial<PdsConfig>\n plc: Partial<PlcConfig>\n bsky: Partial<BskyConfig>\n ozone: Partial<OzoneConfig>\n introspect: Partial<IntrospectConfig>\n}\n\nexport type DidAndKey = {\n did: DidString\n key: Keypair\n}\n"]}
package/dist/util.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAOlD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,GAAY,EAAE,IAAe,EAAE,EAAE;IACpE,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,CAAA;IACtC,IAAI,IAAI,EAAE,CAAC;QACT,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,CAAA;QACvC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,GAAG,CAAC,CAAA;IAC/C,CAAC;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,UAAsB,EACtB,GAAY;AACZ,uFAAuF;AACvF,gBAAgB,GAAW,GAAG,CAAC,GAAG,EAClC,EAAE;IACF,8DAA8D;IAC9D,MAAM,cAAc,GAAG,UAAU,CAAC,GAAG,CAAC,cAAc,CAAA;IACpD,UAAU,CAAC,GAAG,CAAC,cAAc,GAA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KAAK,EAAE,IAIrC,EAAsB,EAAE;IACvB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;IACpC,MAAM,GAAG,GAAG,MAAM,gBAAgB,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAA;IAC/D,MAAM,GAAG,GAAG,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC;QACjD,UAAU,EAAE,GAAG,CAAC,GAAG,EAAE;QACrB,YAAY,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;QACzB,MAAM;QACN,GAAG;QACH,MAAM,EAAE,GAAG;KACZ,CAAC,CAAA;IACF,OAAO;QACL,GAAG;QACH,GAAG,EAAE,GAAgB;KACtB,CAAA;AACH,CAAC,CAAA","sourcesContent":["import * as plc from '@did-plc/lib'\nimport { request } from 'undici'\nimport { Secp256k1Keypair } from '@atproto/crypto'\nimport type { IdResolver } from '@atproto/identity'\nimport type { DidString } from '@atproto/lex'\nimport type { TestBsky } from './bsky.js'\nimport type { TestPds } from './pds.js'\nimport type { DidAndKey } from './types.js'\n\nexport const mockNetworkUtilities = (pds: TestPds, bsky?: TestBsky) => {\n mockResolvers(pds.ctx.idResolver, pds)\n if (bsky) {\n mockResolvers(bsky.ctx.idResolver, pds)\n mockResolvers(bsky.dataplane.idResolver, pds)\n }\n}\n\nexport const mockResolvers = (\n idResolver: IdResolver,\n pds: TestPds,\n // handles resolve against the pds by default, but may point elsewhere e.g. an entryway\n handleResolveUrl: string = pds.url,\n) => {\n // Map pds public url to its local url when resolving from plc\n const origResolveDid = idResolver.did.resolveNoCache\n idResolver.did.resolveNoCache = async (did: string) => {\n const result = await (origResolveDid.call(\n idResolver.did,\n did,\n ) as ReturnType<typeof origResolveDid>)\n const service = result?.service?.find((svc) => svc.id === '#atproto_pds')\n if (typeof service?.serviceEndpoint === 'string') {\n service.serviceEndpoint = service.serviceEndpoint.replace(\n pds.ctx.cfg.service.publicUrl,\n `http://localhost:${pds.port}`,\n )\n }\n return result\n }\n\n const origResolveHandleDns = idResolver.handle.resolveDns\n idResolver.handle.resolve = async (handle: string) => {\n const isPdsHandle = pds.ctx.cfg.identity.serviceHandleDomains.some(\n (domain) => handle.endsWith(domain),\n )\n if (!isPdsHandle) {\n return origResolveHandleDns.call(idResolver.handle, handle)\n }\n\n const url = new URL(`/.well-known/atproto-did`, handleResolveUrl)\n try {\n const res = await request(url, { headers: { host: handle } })\n if (res.statusCode !== 200) {\n await res.body.dump()\n return undefined\n }\n\n return res.body.text()\n } catch (err) {\n return undefined\n }\n }\n}\n\nexport const mockMailer = (pds: TestPds) => {\n const mailer = pds.ctx.mailer\n const _origSendMail = mailer.transporter.sendMail\n mailer.transporter.sendMail = async (opts) => {\n const result = await _origSendMail.call(mailer.transporter, opts)\n console.log(`✉️ Email: ${JSON.stringify(result, null, 2)}`)\n return result\n }\n}\n\nconst usedLockIds = new Set()\nexport const uniqueLockId = () => {\n let lockId: number\n do {\n lockId = 1000 + Math.ceil(1000 * Math.random())\n } while (usedLockIds.has(lockId))\n usedLockIds.add(lockId)\n return lockId\n}\n\nexport const createDidAndKey = async (opts: {\n plcUrl: string\n handle: string\n pds: string\n}): Promise<DidAndKey> => {\n const { plcUrl, handle, pds } = opts\n const key = await Secp256k1Keypair.create({ exportable: true })\n const did = await new plc.Client(plcUrl).createDid({\n signingKey: key.did(),\n rotationKeys: [key.did()],\n handle,\n pds,\n signer: key,\n })\n return {\n key,\n did: did as DidString,\n }\n}\n"]}
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAOlD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,GAAY,EA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AAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAA;QAC3D,OAAO,MAAM,CAAA;IACf,CAAC,CAAA;AACH,CAAC,CAAA;AAED,MAAM,WAAW,GAAG,IAAI,GAAG,EAAE,CAAA;AAC7B,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,IAAI,MAAc,CAAA;IAClB,GAAG,CAAC;QACF,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;IACjD,CAAC,QAAQ,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,EAAC;IACjC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IACvB,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAAE,IAIrC,EAAsB,EAAE;IACvB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;IACpC,MAAM,GAAG,GAAG,MAAM,gBAAgB,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAA;IAC/D,MAAM,GAAG,GAAG,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC;QACjD,UAAU,EAAE,GAAG,CAAC,GAAG,EAAE;QACrB,YAAY,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;QACzB,MAAM;QACN,GAAG;QACH,MAAM,EAAE,GAAG;KACZ,CAAC,CAAA;IACF,OAAO;QACL,GAAG;QACH,GAAG,EAAE,GAAgB;KACtB,CAAA;AACH,CAAC,CAAA","sourcesContent":["import * as plc from '@did-plc/lib'\nimport { request } from 'undici'\nimport { Secp256k1Keypair } from '@atproto/crypto'\nimport type { IdResolver } from '@atproto/identity'\nimport type { DidString } from '@atproto/lex-schema'\nimport type { TestBsky } from './bsky.js'\nimport type { TestPds } from './pds.js'\nimport type { DidAndKey } from './types.js'\n\nexport const mockNetworkUtilities = (pds: TestPds, bsky?: TestBsky) => {\n mockResolvers(pds.ctx.idResolver, pds)\n if (bsky) {\n mockResolvers(bsky.ctx.idResolver, pds)\n mockResolvers(bsky.dataplane.idResolver, pds)\n }\n}\n\nexport const mockResolvers = (\n idResolver: IdResolver,\n pds: TestPds,\n // handles resolve against the pds by default, but may point elsewhere e.g. an entryway\n handleResolveUrl: string = pds.url,\n) => {\n // Map pds public url to its local url when resolving from plc\n const origResolveDid = idResolver.did.resolveNoCache\n idResolver.did.resolveNoCache = async (did: string) => {\n const result = await (origResolveDid.call(\n idResolver.did,\n did,\n ) as ReturnType<typeof origResolveDid>)\n const service = result?.service?.find((svc) => svc.id === '#atproto_pds')\n if (typeof service?.serviceEndpoint === 'string') {\n service.serviceEndpoint = service.serviceEndpoint.replace(\n pds.ctx.cfg.service.publicUrl,\n `http://localhost:${pds.port}`,\n )\n }\n return result\n }\n\n const origResolveHandleDns = idResolver.handle.resolveDns\n idResolver.handle.resolve = async (handle: string) => {\n const isPdsHandle = pds.ctx.cfg.identity.serviceHandleDomains.some(\n (domain) => handle.endsWith(domain),\n )\n if (!isPdsHandle) {\n return origResolveHandleDns.call(idResolver.handle, handle)\n }\n\n const url = new URL(`/.well-known/atproto-did`, handleResolveUrl)\n try {\n const res = await request(url, { headers: { host: handle } })\n if (res.statusCode !== 200) {\n await res.body.dump()\n return undefined\n }\n\n return res.body.text()\n } catch (err) {\n return undefined\n }\n }\n}\n\nexport const mockMailer = (pds: TestPds) => {\n const mailer = pds.ctx.mailer\n const _origSendMail = mailer.transporter.sendMail\n mailer.transporter.sendMail = async (opts) => {\n const result = await _origSendMail.call(mailer.transporter, opts)\n console.log(`✉️ Email: ${JSON.stringify(result, null, 2)}`)\n return result\n }\n}\n\nconst usedLockIds = new Set()\nexport const uniqueLockId = () => {\n let lockId: number\n do {\n lockId = 1000 + Math.ceil(1000 * Math.random())\n } while (usedLockIds.has(lockId))\n usedLockIds.add(lockId)\n return lockId\n}\n\nexport const createDidAndKey = async (opts: {\n plcUrl: string\n handle: string\n pds: string\n}): Promise<DidAndKey> => {\n const { plcUrl, handle, pds } = opts\n const key = await Secp256k1Keypair.create({ exportable: true })\n const did = await new plc.Client(plcUrl).createDid({\n signingKey: key.did(),\n rotationKeys: [key.did()],\n handle,\n pds,\n signer: key,\n })\n return {\n key,\n did: did as DidString,\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/dev-env",
3
- "version": "0.7.0",
3
+ "version": "0.7.4",
4
4
  "license": "MIT",
5
5
  "description": "Local development environment helper for atproto development",
6
6
  "keywords": [
@@ -20,6 +20,9 @@
20
20
  "./README.md",
21
21
  "./CHANGELOG.md"
22
22
  ],
23
+ "bin": {
24
+ "dev-env": "bin.js"
25
+ },
23
26
  "type": "module",
24
27
  "exports": {
25
28
  ".": {
@@ -31,6 +34,20 @@
31
34
  "node": ">=22"
32
35
  },
33
36
  "dependencies": {
37
+ "@atproto/api": "^0.30.3",
38
+ "@atproto/bsky": "^0.5.3",
39
+ "@atproto/bsync": "^0.1.8",
40
+ "@atproto/common-web": "^0.5.17",
41
+ "@atproto/crypto": "^0.5.7",
42
+ "@atproto/identity": "^0.5.23",
43
+ "@atproto/lex-client": "^0.4.2",
44
+ "@atproto/lex-schema": "^0.2.11",
45
+ "@atproto/lexicon": "^0.7.19",
46
+ "@atproto/ozone": "^0.12.3",
47
+ "@atproto/pds": "^0.5.55",
48
+ "@atproto/sync": "^0.4.23",
49
+ "@atproto/syntax": "^0.7.7",
50
+ "@atproto/xrpc-server": "^0.13.9",
34
51
  "@did-plc/lib": "^0.0.1",
35
52
  "@did-plc/server": "^0.0.1",
36
53
  "express": "^4.18.2",
@@ -38,20 +55,7 @@
38
55
  "http-terminator": "^3.2.0",
39
56
  "multiformats": "^13.0.0",
40
57
  "uint8arrays": "^5.0.0",
41
- "undici": "^8.12.2",
42
- "@atproto/api": "^0.29.6",
43
- "@atproto/bsky": "^0.4.0",
44
- "@atproto/bsync": "^0.1.6",
45
- "@atproto/common-web": "^0.5.15",
46
- "@atproto/crypto": "^0.5.7",
47
- "@atproto/identity": "^0.5.20",
48
- "@atproto/lexicon": "^0.7.17",
49
- "@atproto/lex": "^0.4.4",
50
- "@atproto/ozone": "^0.11.0",
51
- "@atproto/pds": "^0.5.52",
52
- "@atproto/syntax": "^0.7.7",
53
- "@atproto/sync": "^0.4.20",
54
- "@atproto/xrpc-server": "^0.13.7"
58
+ "undici": "^8.12.2"
55
59
  },
56
60
  "devDependencies": {
57
61
  "@types/express": "^4.17.13"
@@ -60,8 +64,5 @@
60
64
  "build": "tsc --build tsconfig.build.json",
61
65
  "start": "../dev-infra/with-test-redis-and-db.sh node --enable-source-maps dist/bin.js",
62
66
  "dev": "../dev-infra/with-test-redis-and-db.sh node --enable-source-maps --watch dist/bin.js"
63
- },
64
- "bin": {
65
- "dev-env": "bin.js"
66
67
  }
67
68
  }
package/src/bin.ts CHANGED
File without changes
package/src/bsky.ts CHANGED
@@ -4,7 +4,8 @@ import { AtpAgent } from '@atproto/api'
4
4
  import * as bsky from '@atproto/bsky'
5
5
  import { SECOND } from '@atproto/common-web'
6
6
  import { Secp256k1Keypair } from '@atproto/crypto'
7
- import { Client, type UriString } from '@atproto/lex'
7
+ import { Client } from '@atproto/lex-client'
8
+ import type { UriString } from '@atproto/lex-schema'
8
9
  import type { DidString } from '@atproto/syntax'
9
10
  import { ADMIN_PASSWORD, EXAMPLE_LABELER } from './const.js'
10
11
  import getPort from './get-port.js'
package/src/ozone.ts CHANGED
@@ -2,7 +2,8 @@ import * as plc from '@did-plc/lib'
2
2
  import * as ui8 from 'uint8arrays'
3
3
  import { AtpAgent } from '@atproto/api'
4
4
  import { type Keypair, Secp256k1Keypair } from '@atproto/crypto'
5
- import { Client, type DidString } from '@atproto/lex'
5
+ import { Client } from '@atproto/lex-client'
6
+ import type { DidString } from '@atproto/lex-schema'
6
7
  import * as ozone from '@atproto/ozone'
7
8
  import { createServiceJwt } from '@atproto/xrpc-server'
8
9
  import { ADMIN_PASSWORD, EXAMPLE_LABELER } from './const.js'
package/src/pds.ts CHANGED
@@ -4,7 +4,8 @@ import path from 'node:path'
4
4
  import * as ui8 from 'uint8arrays'
5
5
  import { AtpAgent } from '@atproto/api'
6
6
  import { Secp256k1Keypair, randomStr } from '@atproto/crypto'
7
- import { Client, type UriString } from '@atproto/lex'
7
+ import { Client } from '@atproto/lex-client'
8
+ import type { UriString } from '@atproto/lex-schema'
8
9
  import {
9
10
  type AppContext,
10
11
  type AppContextOptions,
@@ -19,7 +19,8 @@ import type {
19
19
  ComAtprotoModerationCreateReport,
20
20
  ComAtprotoRepoStrongRef,
21
21
  } from '@atproto/api'
22
- import type { CidString, Client } from '@atproto/lex'
22
+ import type { Client } from '@atproto/lex-client'
23
+ import type { CidString } from '@atproto/lex-schema'
23
24
  import type { BlobRef } from '@atproto/lexicon'
24
25
  import {
25
26
  AtUri,
@@ -1,5 +1,5 @@
1
1
  import type { AtpAgent } from '@atproto/api'
2
- import type { DidString } from '@atproto/lex'
2
+ import type { DidString } from '@atproto/lex-schema'
3
3
  import type { TestPds } from './pds.js'
4
4
 
5
5
  export type ServiceUserDetails = {
package/src/types.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type * as bsky from '@atproto/bsky'
2
2
  import type * as bsync from '@atproto/bsync'
3
3
  import type { ExportableKeypair, Keypair } from '@atproto/crypto'
4
- import type { DidString } from '@atproto/lex'
4
+ import type { DidString } from '@atproto/lex-schema'
5
5
  import type * as ozone from '@atproto/ozone'
6
6
  import type * as pds from '@atproto/pds'
7
7
 
package/src/util.ts CHANGED
@@ -2,7 +2,7 @@ import * as plc from '@did-plc/lib'
2
2
  import { request } from 'undici'
3
3
  import { Secp256k1Keypair } from '@atproto/crypto'
4
4
  import type { IdResolver } from '@atproto/identity'
5
- import type { DidString } from '@atproto/lex'
5
+ import type { DidString } from '@atproto/lex-schema'
6
6
  import type { TestBsky } from './bsky.js'
7
7
  import type { TestPds } from './pds.js'
8
8
  import type { DidAndKey } from './types.js'
@@ -8,7 +8,8 @@
8
8
  { "path": "../common-web/tsconfig.build.json" },
9
9
  { "path": "../crypto/tsconfig.build.json" },
10
10
  { "path": "../identity/tsconfig.build.json" },
11
- { "path": "../lex/lex/tsconfig.build.json" },
11
+ { "path": "../lex/lex-client/tsconfig.build.json" },
12
+ { "path": "../lex/lex-schema/tsconfig.build.json" },
12
13
  { "path": "../lexicon/tsconfig.build.json" },
13
14
  { "path": "../ozone/tsconfig.build.json" },
14
15
  { "path": "../pds/tsconfig.build.json" },