@atproto/dev-env 0.5.43 → 0.5.44

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,24 @@
1
1
  # @atproto/dev-env
2
2
 
3
+ ## 0.5.44
4
+
5
+ ### Patch Changes
6
+
7
+ - [#5305](https://github.com/bluesky-social/atproto/pull/5305) [`fca9bd8`](https://github.com/bluesky-social/atproto/commit/fca9bd8fd3384a1f45f9540654edac8db774aecb) Thanks [@bigmoves](https://github.com/bigmoves)! - Simplify branding color customization to match the redesigned OAuth UI. Each color is a single RGB value (`primary`, `error`, `warning`, `info`, `success`). Only `primary` gets a foreground (`--primary-foreground`), now computed automatically as black or white — whichever has the higher WCAG 2.1 contrast against `primary`. It can no longer be overridden or tuned.
8
+
9
+ BREAKING (`@atproto/oauth-provider`): The `light`, `dark`, `contrastSaturation`, and all `{name}Contrast` / `{name}Hue` options are removed from `branding.colors` (only the flat `{name}` colors remain). `buildCustomizationCss` now emits `--branding-color-{name}` for each configured color plus a computed `--branding-color-primary-contrast`; it no longer emits any `--branding-color-{name}-hue`, the non-primary `--branding-color-{name}-contrast`, or the global `--contrast-sat`. Deployments that previously set an explicit primary foreground should instead choose a `primary` color that yields the desired foreground under the WCAG contrast computation.
10
+
11
+ BREAKING (`@atproto/pds`): The `PDS_LIGHT_COLOR`, `PDS_DARK_COLOR`, `PDS_CONTRAST_SATURATION`, `PDS_{PRIMARY,ERROR,WARNING,INFO,SUCCESS}_COLOR_CONTRAST`, and `PDS_{PRIMARY,ERROR,WARNING,INFO,SUCCESS}_COLOR_HUE` environment variables are removed.
12
+
13
+ - Updated dependencies [[`fca9bd8`](https://github.com/bluesky-social/atproto/commit/fca9bd8fd3384a1f45f9540654edac8db774aecb), [`c2c31c7`](https://github.com/bluesky-social/atproto/commit/c2c31c7cffcacd37149e5ace02cf1cdfffb1472c), [`b66870d`](https://github.com/bluesky-social/atproto/commit/b66870d5a1efbcfa0cc07498c7cfcf3f0f243e86), [`b66870d`](https://github.com/bluesky-social/atproto/commit/b66870d5a1efbcfa0cc07498c7cfcf3f0f243e86), [`b66870d`](https://github.com/bluesky-social/atproto/commit/b66870d5a1efbcfa0cc07498c7cfcf3f0f243e86), [`fca9bd8`](https://github.com/bluesky-social/atproto/commit/fca9bd8fd3384a1f45f9540654edac8db774aecb), [`1bde0b0`](https://github.com/bluesky-social/atproto/commit/1bde0b0e1205abb49d254d5deba28e29e42a93e2), [`b66870d`](https://github.com/bluesky-social/atproto/commit/b66870d5a1efbcfa0cc07498c7cfcf3f0f243e86), [`b66870d`](https://github.com/bluesky-social/atproto/commit/b66870d5a1efbcfa0cc07498c7cfcf3f0f243e86), [`b66870d`](https://github.com/bluesky-social/atproto/commit/b66870d5a1efbcfa0cc07498c7cfcf3f0f243e86), [`b66870d`](https://github.com/bluesky-social/atproto/commit/b66870d5a1efbcfa0cc07498c7cfcf3f0f243e86), [`b66870d`](https://github.com/bluesky-social/atproto/commit/b66870d5a1efbcfa0cc07498c7cfcf3f0f243e86), [`b66870d`](https://github.com/bluesky-social/atproto/commit/b66870d5a1efbcfa0cc07498c7cfcf3f0f243e86)]:
14
+ - @atproto/pds@0.5.26
15
+ - @atproto/bsky@0.0.272
16
+ - @atproto/bsync@0.0.40
17
+ - @atproto/ozone@0.2.26
18
+ - @atproto/sync@0.4.2
19
+ - @atproto/xrpc-server@0.12.2
20
+ - @atproto/lex@0.3.5
21
+
3
22
  ## 0.5.43
4
23
 
5
24
  ### Patch Changes
package/dist/pds.d.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  import { AtpAgent } from '@atproto/api';
2
2
  import { Client } from '@atproto/lex';
3
- import * as pds from '@atproto/pds';
3
+ import { type AppContext, PDS } from '@atproto/pds';
4
4
  import type { PdsConfig } from './types.js';
5
5
  export declare class TestPds {
6
6
  url: string;
7
7
  port: number;
8
- server: pds.PDS;
9
- constructor(url: string, port: number, server: pds.PDS);
8
+ server: PDS;
9
+ constructor(url: string, port: number, server: PDS);
10
10
  static create(config: PdsConfig): Promise<TestPds>;
11
- get ctx(): pds.AppContext;
11
+ get ctx(): AppContext;
12
12
  getAgent(): AtpAgent;
13
13
  getClient(): Client;
14
14
  adminAuth(): string;
package/dist/pds.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"pds.d.ts","sourceRoot":"","sources":["../src/pds.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AAGnC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3C,qBAAa,OAAO;IAET,GAAG,EAAE,MAAM;IACX,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,GAAG,CAAC,GAAG;IAHxB,YACS,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,GAAG,CAAC,GAAG,EACpB;IAEJ,OAAa,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,CAsDvD;IAED,IAAI,GAAG,IAAI,GAAG,CAAC,UAAU,CAExB;IAED,QAAQ,IAAI,QAAQ,CAInB;IAED,SAAS,IAAI,MAAM,CAIlB;IAED,SAAS,IAAI,MAAM,CAQlB;IAED,gBAAgB;QAEZ,aAAa;MAEhB;IAED,YAAY,+BAEX;IAEK,UAAU,kBAEf;IAEK,KAAK,kBAEV;IAEK,CAAC,MAAM,CAAC,YAAY,CAAC,kBAE1B;CACF"}
1
+ {"version":3,"file":"pds.d.ts","sourceRoot":"","sources":["../src/pds.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,KAAK,UAAU,EAAE,GAAG,EAAyB,MAAM,cAAc,CAAA;AAE1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3C,qBAAa,OAAO;IAET,GAAG,EAAE,MAAM;IACX,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,GAAG;IAHpB,YACS,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,GAAG,EAChB;IAEJ,OAAa,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,CAiDvD;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,+BAEX;IAEK,UAAU,kBAEf;IAEK,KAAK,kBAEV;IAEK,CAAC,MAAM,CAAC,YAAY,CAAC,kBAE1B;CACF"}
package/dist/pds.js CHANGED
@@ -6,8 +6,7 @@ import * as ui8 from 'uint8arrays';
6
6
  import { AtpAgent } from '@atproto/api';
7
7
  import { Secp256k1Keypair, randomStr } from '@atproto/crypto';
8
8
  import { Client } from '@atproto/lex';
9
- import * as pds from '@atproto/pds';
10
- import { createSecretKeyObject } from '@atproto/pds';
9
+ import { PDS, createSecretKeyObject } from '@atproto/pds';
11
10
  import { ADMIN_PASSWORD, EXAMPLE_LABELER, JWT_SECRET } from './const.js';
12
11
  export class TestPds {
13
12
  constructor(url, port, server) {
@@ -24,7 +23,7 @@ export class TestPds {
24
23
  const blobstoreLoc = path.join(os.tmpdir(), randomStr(8, 'base32'));
25
24
  const dataDirectory = path.join(os.tmpdir(), randomStr(8, 'base32'));
26
25
  await fs.mkdir(dataDirectory, { recursive: true });
27
- const env = {
26
+ const server = await PDS.fromEnv({
28
27
  devMode: true,
29
28
  port,
30
29
  dataDirectory: dataDirectory,
@@ -45,7 +44,6 @@ export class TestPds {
45
44
  disableSsrfProtection: true,
46
45
  serviceName: 'Development PDS',
47
46
  primaryColor: '#f0828d',
48
- primaryColorContrast: '#fff', // Bad contrast for a11y (WCAG AA)
49
47
  errorColor: 'rgb(238, 0, 78)', // rgb() notation should work too
50
48
  logoUrl:
51
49
  // Using a "data:" instead of a real URL to avoid making CORS requests in dev.
@@ -57,10 +55,7 @@ export class TestPds {
57
55
  privacyPolicyUrl: 'https://bsky.social/about/support/privacy-policy',
58
56
  supportUrl: 'https://blueskyweb.zendesk.com/hc/en-us',
59
57
  ...config,
60
- };
61
- const cfg = pds.envToCfg(env);
62
- const secrets = pds.envToSecrets(env);
63
- const server = await pds.PDS.create(cfg, secrets);
58
+ });
64
59
  await server.start();
65
60
  return new TestPds(url, port, server);
66
61
  }
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,OAAO,MAAM,UAAU,CAAA;AAC9B,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,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAGxE,MAAM,OAAO,OAAO;IAClB,YACS,GAAW,EACX,IAAY,EACZ,MAAe;mBAFf,GAAG;oBACH,IAAI;sBACJ,MAAM;IACZ,CAAC;IAEJ,MAAM,CAAC,KAAK,CAAC,MAA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QAChD,MAAM,CAAC,WAAW,CAAC,CAAC,eAAe,CAAC,CAAC,CAAA;QACrC,OAAO,MAAM,CAAA;IACf,CAAC;IAED,SAAS;QACP,OAAO,CACL,QAAQ;YACR,GAAG,CAAC,QAAQ,CACV,GAAG,CAAC,UAAU,CAAC,SAAS,cAAc,EAAE,EAAE,MAAM,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","sourcesContent":["import fs from 'node:fs/promises'\nimport os from 'node:os'\nimport path from 'node:path'\nimport getPort from 'get-port'\nimport * as ui8 from 'uint8arrays'\nimport { AtpAgent } from '@atproto/api'\nimport { Secp256k1Keypair, randomStr } from '@atproto/crypto'\nimport { Client } from '@atproto/lex'\nimport * as pds from '@atproto/pds'\nimport { createSecretKeyObject } from '@atproto/pds'\nimport { ADMIN_PASSWORD, EXAMPLE_LABELER, JWT_SECRET } from './const.js'\nimport type { PdsConfig } from './types.js'\n\nexport class TestPds {\n constructor(\n public url: string,\n public port: number,\n public server: pds.PDS,\n ) {}\n\n static async create(config: PdsConfig): Promise<TestPds> {\n const plcRotationKey = await Secp256k1Keypair.create({ exportable: true })\n const plcRotationPriv = ui8.toString(await plcRotationKey.export(), 'hex')\n const recoveryKey = (await Secp256k1Keypair.create()).did()\n\n const port = config.port || (await getPort())\n const url = `http://localhost:${port}`\n\n const blobstoreLoc = path.join(os.tmpdir(), randomStr(8, 'base32'))\n const dataDirectory = path.join(os.tmpdir(), randomStr(8, 'base32'))\n await fs.mkdir(dataDirectory, { recursive: true })\n\n const env: pds.ServerEnvironment = {\n devMode: true,\n port,\n dataDirectory: dataDirectory,\n blobstoreDiskLocation: blobstoreLoc,\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: plcRotationPriv,\n inviteRequired: false,\n disableSsrfProtection: true,\n serviceName: 'Development PDS',\n primaryColor: '#f0828d',\n primaryColorContrast: '#fff', // Bad contrast for a11y (WCAG AA)\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 ...config,\n }\n const cfg = pds.envToCfg(env)\n const secrets = pds.envToSecrets(env)\n\n const server = await pds.PDS.create(cfg, secrets)\n\n await server.start()\n\n return new TestPds(url, port, server)\n }\n\n get ctx(): pds.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"]}
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,OAAO,MAAM,UAAU,CAAA;AAC9B,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,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAmB,GAAG,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAC1E,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAGxE,MAAM,OAAO,OAAO;IAClB,YACS,GAAW,EACX,IAAY,EACZ,MAAW;mBAFX,GAAG;oBACH,IAAI;sBACJ,MAAM;IACZ,CAAC;IAEJ,MAAM,CAAC,KAAK,CAAC,MAAM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ACF,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","sourcesContent":["import fs from 'node:fs/promises'\nimport os from 'node:os'\nimport path from 'node:path'\nimport getPort from 'get-port'\nimport * as ui8 from 'uint8arrays'\nimport { AtpAgent } from '@atproto/api'\nimport { Secp256k1Keypair, randomStr } from '@atproto/crypto'\nimport { Client } from '@atproto/lex'\nimport { type AppContext, PDS, createSecretKeyObject } from '@atproto/pds'\nimport { ADMIN_PASSWORD, EXAMPLE_LABELER, JWT_SECRET } from './const.js'\nimport type { PdsConfig } from './types.js'\n\nexport class TestPds {\n constructor(\n public url: string,\n public port: number,\n public server: PDS,\n ) {}\n\n static async create(config: PdsConfig): Promise<TestPds> {\n const plcRotationKey = await Secp256k1Keypair.create({ exportable: true })\n const plcRotationPriv = ui8.toString(await plcRotationKey.export(), 'hex')\n const recoveryKey = (await Secp256k1Keypair.create()).did()\n\n const port = config.port || (await getPort())\n const url = `http://localhost:${port}`\n\n const blobstoreLoc = path.join(os.tmpdir(), randomStr(8, 'base32'))\n const dataDirectory = path.join(os.tmpdir(), randomStr(8, 'base32'))\n await fs.mkdir(dataDirectory, { recursive: true })\n\n const server = await PDS.fromEnv({\n devMode: true,\n port,\n dataDirectory: dataDirectory,\n blobstoreDiskLocation: blobstoreLoc,\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: plcRotationPriv,\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 ...config,\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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/dev-env",
3
- "version": "0.5.43",
3
+ "version": "0.5.44",
4
4
  "license": "MIT",
5
5
  "description": "Local development environment helper for atproto development",
6
6
  "keywords": [
@@ -41,18 +41,18 @@
41
41
  "uint8arrays": "^5.0.0",
42
42
  "undici": "^8.5.0",
43
43
  "@atproto/api": "^0.20.38",
44
- "@atproto/bsky": "^0.0.271",
45
- "@atproto/common-web": "^0.5.9",
46
- "@atproto/crypto": "^0.5.4",
47
- "@atproto/bsync": "^0.0.39",
44
+ "@atproto/bsky": "^0.0.272",
48
45
  "@atproto/identity": "^0.5.9",
49
- "@atproto/lex": "^0.3.4",
46
+ "@atproto/crypto": "^0.5.4",
47
+ "@atproto/ozone": "^0.2.26",
48
+ "@atproto/lex": "^0.3.5",
49
+ "@atproto/bsync": "^0.0.40",
50
50
  "@atproto/lexicon": "^0.7.11",
51
- "@atproto/ozone": "^0.2.25",
52
- "@atproto/pds": "^0.5.25",
53
- "@atproto/sync": "^0.4.1",
54
- "@atproto/syntax": "^0.7.4",
55
- "@atproto/xrpc-server": "^0.12.1"
51
+ "@atproto/pds": "^0.5.26",
52
+ "@atproto/common-web": "^0.5.9",
53
+ "@atproto/sync": "^0.4.2",
54
+ "@atproto/xrpc-server": "^0.12.2",
55
+ "@atproto/syntax": "^0.7.4"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@types/express": "^4.17.13"
package/src/pds.ts CHANGED
@@ -6,8 +6,7 @@ import * as ui8 from 'uint8arrays'
6
6
  import { AtpAgent } from '@atproto/api'
7
7
  import { Secp256k1Keypair, randomStr } from '@atproto/crypto'
8
8
  import { Client } from '@atproto/lex'
9
- import * as pds from '@atproto/pds'
10
- import { createSecretKeyObject } from '@atproto/pds'
9
+ import { type AppContext, PDS, createSecretKeyObject } from '@atproto/pds'
11
10
  import { ADMIN_PASSWORD, EXAMPLE_LABELER, JWT_SECRET } from './const.js'
12
11
  import type { PdsConfig } from './types.js'
13
12
 
@@ -15,7 +14,7 @@ export class TestPds {
15
14
  constructor(
16
15
  public url: string,
17
16
  public port: number,
18
- public server: pds.PDS,
17
+ public server: PDS,
19
18
  ) {}
20
19
 
21
20
  static async create(config: PdsConfig): Promise<TestPds> {
@@ -30,7 +29,7 @@ export class TestPds {
30
29
  const dataDirectory = path.join(os.tmpdir(), randomStr(8, 'base32'))
31
30
  await fs.mkdir(dataDirectory, { recursive: true })
32
31
 
33
- const env: pds.ServerEnvironment = {
32
+ const server = await PDS.fromEnv({
34
33
  devMode: true,
35
34
  port,
36
35
  dataDirectory: dataDirectory,
@@ -51,7 +50,6 @@ export class TestPds {
51
50
  disableSsrfProtection: true,
52
51
  serviceName: 'Development PDS',
53
52
  primaryColor: '#f0828d',
54
- primaryColorContrast: '#fff', // Bad contrast for a11y (WCAG AA)
55
53
  errorColor: 'rgb(238, 0, 78)', // rgb() notation should work too
56
54
  logoUrl:
57
55
  // Using a "data:" instead of a real URL to avoid making CORS requests in dev.
@@ -63,18 +61,14 @@ export class TestPds {
63
61
  privacyPolicyUrl: 'https://bsky.social/about/support/privacy-policy',
64
62
  supportUrl: 'https://blueskyweb.zendesk.com/hc/en-us',
65
63
  ...config,
66
- }
67
- const cfg = pds.envToCfg(env)
68
- const secrets = pds.envToSecrets(env)
69
-
70
- const server = await pds.PDS.create(cfg, secrets)
64
+ })
71
65
 
72
66
  await server.start()
73
67
 
74
68
  return new TestPds(url, port, server)
75
69
  }
76
70
 
77
- get ctx(): pds.AppContext {
71
+ get ctx(): AppContext {
78
72
  return this.server.ctx
79
73
  }
80
74