@atproto/bsky 0.0.207 → 0.0.208

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,15 @@
1
1
  # @atproto/bsky
2
2
 
3
+ ## 0.0.208
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b329266`](https://github.com/bluesky-social/atproto/commit/b329266853b4867fbbcafc8845e479c888f8ac36) Thanks [@mary-ext](https://github.com/mary-ext)! - properly convert did:web to service endpoints in `.well-known/did.json`
8
+
9
+ - Updated dependencies []:
10
+ - @atproto/common@0.5.7
11
+ - @atproto/xrpc-server@0.10.8
12
+
3
13
  ## 0.0.207
4
14
 
5
15
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"well-known.d.ts","sourceRoot":"","sources":["../../src/api/well-known.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvC,eAAO,MAAM,YAAY,GAAI,KAAK,UAAU,KAAG,MAwC9C,CAAA"}
1
+ {"version":3,"file":"well-known.d.ts","sourceRoot":"","sources":["../../src/api/well-known.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvC,eAAO,MAAM,YAAY,GAAI,KAAK,UAAU,KAAG,MAuC9C,CAAA"}
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createRouter = void 0;
4
4
  const express_1 = require("express");
5
+ const did_1 = require("@atproto/did");
5
6
  const createRouter = (ctx) => {
6
7
  const router = (0, express_1.Router)();
7
8
  const did = ctx.cfg.serverDid;
8
- if (did.startsWith('did:web:')) {
9
- const hostname = did.slice('did:web:'.length);
10
- const serviceEndpoint = `https://${hostname}`;
9
+ if ((0, did_1.isDidWeb)(did)) {
10
+ const serviceEndpoint = (0, did_1.didWebToUrl)(did).origin;
11
11
  router.get('/.well-known/did.json', (_req, res) => {
12
12
  res.json({
13
13
  '@context': [
@@ -1 +1 @@
1
- {"version":3,"file":"well-known.js","sourceRoot":"","sources":["../../src/api/well-known.ts"],"names":[],"mappings":";;;AAAA,qCAAgC;AAGzB,MAAM,YAAY,GAAG,CAAC,GAAe,EAAU,EAAE;IACtD,MAAM,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAA;IAEvB,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,SAAS,CAAA;IAC7B,IAAI,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/B,MAAM,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAA;QAC7C,MAAM,eAAe,GAAG,WAAW,QAAQ,EAAE,CAAA;QAE7C,MAAM,CAAC,GAAG,CAAC,uBAAuB,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;YAChD,GAAG,CAAC,IAAI,CAAC;gBACP,UAAU,EAAE;oBACV,8BAA8B;oBAC9B,uCAAuC;iBACxC;gBACD,EAAE,EAAE,GAAG;gBACP,kBAAkB,EAAE;oBAClB;wBACE,EAAE,EAAE,GAAG,GAAG,UAAU;wBACpB,IAAI,EAAE,UAAU;wBAChB,UAAU,EAAE,GAAG;wBACf,kBAAkB,EAAE,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;qBACjE;iBACF;gBACD,OAAO,EAAE;oBACP;wBACE,EAAE,EAAE,aAAa;wBACjB,IAAI,EAAE,yBAAyB;wBAC/B,eAAe;qBAChB;oBACD;wBACE,EAAE,EAAE,eAAe;wBACnB,IAAI,EAAE,aAAa;wBACnB,eAAe;qBAChB;iBACF;aACF,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAxCY,QAAA,YAAY,gBAwCxB","sourcesContent":["import { Router } from 'express'\nimport { AppContext } from '../context'\n\nexport const createRouter = (ctx: AppContext): Router => {\n const router = Router()\n\n const did = ctx.cfg.serverDid\n if (did.startsWith('did:web:')) {\n const hostname = did.slice('did:web:'.length)\n const serviceEndpoint = `https://${hostname}`\n\n router.get('/.well-known/did.json', (_req, res) => {\n res.json({\n '@context': [\n 'https://www.w3.org/ns/did/v1',\n 'https://w3id.org/security/multikey/v1',\n ],\n id: did,\n verificationMethod: [\n {\n id: `${did}#atproto`,\n type: 'Multikey',\n controller: did,\n publicKeyMultibase: ctx.signingKey.did().replace('did:key:', ''),\n },\n ],\n service: [\n {\n id: '#bsky_notif',\n type: 'BskyNotificationService',\n serviceEndpoint,\n },\n {\n id: '#bsky_appview',\n type: 'BskyAppView',\n serviceEndpoint,\n },\n ],\n })\n })\n }\n\n return router\n}\n"]}
1
+ {"version":3,"file":"well-known.js","sourceRoot":"","sources":["../../src/api/well-known.ts"],"names":[],"mappings":";;;AAAA,qCAAgC;AAChC,sCAAoD;AAG7C,MAAM,YAAY,GAAG,CAAC,GAAe,EAAU,EAAE;IACtD,MAAM,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAA;IAEvB,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,SAAS,CAAA;IAC7B,IAAI,IAAA,cAAQ,EAAC,GAAG,CAAC,EAAE,CAAC;QAClB,MAAM,eAAe,GAAG,IAAA,iBAAW,EAAC,GAAG,CAAC,CAAC,MAAM,CAAA;QAE/C,MAAM,CAAC,GAAG,CAAC,uBAAuB,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;YAChD,GAAG,CAAC,IAAI,CAAC;gBACP,UAAU,EAAE;oBACV,8BAA8B;oBAC9B,uCAAuC;iBACxC;gBACD,EAAE,EAAE,GAAG;gBACP,kBAAkB,EAAE;oBAClB;wBACE,EAAE,EAAE,GAAG,GAAG,UAAU;wBACpB,IAAI,EAAE,UAAU;wBAChB,UAAU,EAAE,GAAG;wBACf,kBAAkB,EAAE,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;qBACjE;iBACF;gBACD,OAAO,EAAE;oBACP;wBACE,EAAE,EAAE,aAAa;wBACjB,IAAI,EAAE,yBAAyB;wBAC/B,eAAe;qBAChB;oBACD;wBACE,EAAE,EAAE,eAAe;wBACnB,IAAI,EAAE,aAAa;wBACnB,eAAe;qBAChB;iBACF;aACF,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAvCY,QAAA,YAAY,gBAuCxB","sourcesContent":["import { Router } from 'express'\nimport { didWebToUrl, isDidWeb } from '@atproto/did'\nimport { AppContext } from '../context'\n\nexport const createRouter = (ctx: AppContext): Router => {\n const router = Router()\n\n const did = ctx.cfg.serverDid\n if (isDidWeb(did)) {\n const serviceEndpoint = didWebToUrl(did).origin\n\n router.get('/.well-known/did.json', (_req, res) => {\n res.json({\n '@context': [\n 'https://www.w3.org/ns/did/v1',\n 'https://w3id.org/security/multikey/v1',\n ],\n id: did,\n verificationMethod: [\n {\n id: `${did}#atproto`,\n type: 'Multikey',\n controller: did,\n publicKeyMultibase: ctx.signingKey.did().replace('did:key:', ''),\n },\n ],\n service: [\n {\n id: '#bsky_notif',\n type: 'BskyNotificationService',\n serviceEndpoint,\n },\n {\n id: '#bsky_appview',\n type: 'BskyAppView',\n serviceEndpoint,\n },\n ],\n })\n })\n }\n\n return router\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/bsky",
3
- "version": "0.0.207",
3
+ "version": "0.0.208",
4
4
  "license": "MIT",
5
5
  "description": "Reference implementation of app.bsky App View (Bluesky API)",
6
6
  "keywords": [
@@ -52,9 +52,9 @@
52
52
  "undici": "^6.19.8",
53
53
  "zod": "3.23.8",
54
54
  "@atproto-labs/fetch-node": "0.2.0",
55
- "@atproto/common": "^0.5.6",
56
- "@atproto/api": "^0.18.12",
57
55
  "@atproto-labs/xrpc-utils": "0.0.24",
56
+ "@atproto/api": "^0.18.12",
57
+ "@atproto/common": "^0.5.7",
58
58
  "@atproto/crypto": "^0.4.5",
59
59
  "@atproto/did": "^0.2.4",
60
60
  "@atproto/identity": "^0.4.10",
@@ -62,7 +62,7 @@
62
62
  "@atproto/repo": "^0.8.12",
63
63
  "@atproto/sync": "^0.1.39",
64
64
  "@atproto/syntax": "^0.4.2",
65
- "@atproto/xrpc-server": "^0.10.7"
65
+ "@atproto/xrpc-server": "^0.10.8"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@bufbuild/buf": "^1.28.1",
@@ -80,7 +80,7 @@
80
80
  "typescript": "^5.6.3",
81
81
  "@atproto/api": "^0.18.12",
82
82
  "@atproto/lex-cli": "^0.9.8",
83
- "@atproto/pds": "^0.4.202",
83
+ "@atproto/pds": "^0.4.203",
84
84
  "@atproto/xrpc": "^0.7.7"
85
85
  },
86
86
  "scripts": {
@@ -1,13 +1,13 @@
1
1
  import { Router } from 'express'
2
+ import { didWebToUrl, isDidWeb } from '@atproto/did'
2
3
  import { AppContext } from '../context'
3
4
 
4
5
  export const createRouter = (ctx: AppContext): Router => {
5
6
  const router = Router()
6
7
 
7
8
  const did = ctx.cfg.serverDid
8
- if (did.startsWith('did:web:')) {
9
- const hostname = did.slice('did:web:'.length)
10
- const serviceEndpoint = `https://${hostname}`
9
+ if (isDidWeb(did)) {
10
+ const serviceEndpoint = didWebToUrl(did).origin
11
11
 
12
12
  router.get('/.well-known/did.json', (_req, res) => {
13
13
  res.json({