@atproto/did 0.4.0-next.0 → 0.5.0

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,18 +1,22 @@
1
1
  # @atproto/did
2
2
 
3
- ## 0.4.0-next.0
3
+ ## 0.5.0
4
4
 
5
5
  ### Minor Changes
6
6
 
7
- - [#4929](https://github.com/bluesky-social/atproto/pull/4929) [`bb7491c`](https://github.com/bluesky-social/atproto/commit/bb7491c29e06181e1d2f8cf6eb454f9bb8ab961b) Thanks [@devinivy](https://github.com/devinivy)! - **BREAKING:** Drop support for Node.js 18 and 20. Node.js 22 is now the minimum supported version. Docker images now use Node.js 24.
7
+ - [#4992](https://github.com/bluesky-social/atproto/pull/4992) [`622d365`](https://github.com/bluesky-social/atproto/commit/622d365aeb240133f40763a3b1c43981112837fc) Thanks [@devinivy](https://github.com/devinivy)! - **BREAKING:** Remove `AtprotoAudience` and `isAtprotoAudience`. They are superseded by `AtprotoDidRefAbsolute` and `isAtprotoDidRefAbsolute`. Adds the related `DidRefAbsolute` and `DidRefRelative` types and predicates.
8
8
 
9
- - [#4943](https://github.com/bluesky-social/atproto/pull/4943) [`07ae5d4`](https://github.com/bluesky-social/atproto/commit/07ae5d4452df51e045e0239da7a04cf0bc154028) Thanks [@devinivy](https://github.com/devinivy)! - **BREAKING:** Convert to pure ESM. All packages now ship `"type": "module"` with ES module output and Node16 module resolution.
9
+ ## 0.4.0
10
10
 
11
- Node.js 22's `require()` compatibility layer can still load these packages in CommonJS code.
11
+ ### Minor Changes
12
+
13
+ - [#4929](https://github.com/bluesky-social/atproto/pull/4929) [`f01c59f`](https://github.com/bluesky-social/atproto/commit/f01c59f5bd3f75fb8b47a9eecd4858b84033fb7c) Thanks [@devinivy](https://github.com/devinivy)! - **BREAKING:** Drop support for Node.js 18 and 20. Node.js 22 is now the minimum supported version. Docker images now use Node.js 24.
12
14
 
13
- - [#4930](https://github.com/bluesky-social/atproto/pull/4930) [`042df15`](https://github.com/bluesky-social/atproto/commit/042df15087c0e62cd1e715fcbf58852fab875af9) Thanks [@devinivy](https://github.com/devinivy)! - Build with TypeScript 6.0. Emitted `.d.ts` files now use TypeScript 6's stricter `Uint8Array<ArrayBuffer>` typing in places where Web/Node APIs require buffer-backed (not shared-memory) byte arrays. Consumers compiling against these types on older TypeScript should see no runtime impact, but may need to widen or cast in spots that previously relied on `Uint8Array` defaulting to `<ArrayBufferLike>`.
15
+ - [#4943](https://github.com/bluesky-social/atproto/pull/4943) [`c459153`](https://github.com/bluesky-social/atproto/commit/c459153395a30ce89e050892c8fab7dc98e019b9) Thanks [@devinivy](https://github.com/devinivy)! - **BREAKING:** Convert to pure ESM. All packages now ship `"type": "module"` with ES module output and Node16 module resolution.
16
+
17
+ Node.js 22's `require()` compatibility layer can still load these packages in CommonJS code.
14
18
 
15
- Internal: tsconfig `moduleResolution: "node"` is silenced via `ignoreDeprecations: "6.0"` for now; the proper migration to `node16`/`bundler` resolution is deferred.
19
+ - [#4930](https://github.com/bluesky-social/atproto/pull/4930) [`908bece`](https://github.com/bluesky-social/atproto/commit/908bece169258bff5ad121e5eec157d6ded6f705) Thanks [@devinivy](https://github.com/devinivy)! - Build with TypeScript 6.0.
16
20
 
17
21
  ## 0.3.0
18
22
 
package/dist/atproto.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { DidDocument, DidService } from './did-document.js';
3
+ import { DidRefAbsolute } from './did-ref.js';
3
4
  import { Did } from './did.js';
4
5
  import { Identifier } from './utils.js';
5
6
  export type AtprotoIdentityDidMethods = 'plc' | 'web';
@@ -14,8 +15,6 @@ export declare function assertAtprotoDidWeb(input: unknown): asserts input is Di
14
15
  * @see {@link https://atproto.com/specs/did#blessed-did-methods}
15
16
  */
16
17
  export declare function isAtprotoDidWeb(input: unknown): input is Did<'web'>;
17
- export type AtprotoAudience = `${AtprotoDid}#${string}`;
18
- export declare const isAtprotoAudience: (value: unknown) => value is AtprotoAudience;
19
18
  export type AtprotoData<M extends AtprotoIdentityDidMethods = AtprotoIdentityDidMethods> = {
20
19
  did: Did<M>;
21
20
  aka?: string;
@@ -41,5 +40,10 @@ export type AtprotoVerificationMethod<M extends AtprotoIdentityDidMethods = Atpr
41
40
  publicKeyMultibase: string;
42
41
  };
43
42
  export declare function isAtprotoVerificationMethod<M extends AtprotoIdentityDidMethods = AtprotoIdentityDidMethods>(this: DidDocument<M>, method: null | undefined | NonNullable<DidDocument<M>['verificationMethod']>[number]): method is AtprotoVerificationMethod<M>;
43
+ /**
44
+ * An atproto-constrained absolute DID reference: `${AtprotoDid}#${fragment}`.
45
+ */
46
+ export type AtprotoDidRefAbsolute = DidRefAbsolute<AtprotoIdentityDidMethods>;
47
+ export declare function isAtprotoDidRefAbsolute(value: unknown): value is AtprotoDidRefAbsolute;
44
48
  export {};
45
49
  //# sourceMappingURL=atproto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"atproto.d.ts","sourceRoot":"","sources":["../src/atproto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAU9B,OAAO,EAAE,UAAU,EAAqB,MAAM,YAAY,CAAA;AAI1D,MAAM,MAAM,yBAAyB,GAAG,KAAK,GAAG,KAAK,CAAA;AACrD,MAAM,MAAM,UAAU,GAAG,GAAG,CAAC,yBAAyB,CAAC,CAAA;AACvD,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,yBAAyB,CAAC,CAAA;AAEvE,eAAO,MAAM,gBAAgB,8EAE6C,CAAA;AAE1E,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAEhE;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,yDA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M,EACF,IAAI,GACJ,SAAS,GACT,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,MAAM,CAAC,GAC5D,MAAM,IAAI,yBAAyB,CAAC,CAAC,CAAC,CASxC;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,yBAAyB,CAAC,CAAA;AAE7E,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,qBAAqB,CAGhC"}
package/dist/atproto.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { DidError, InvalidDidError } from './did-error.js';
3
- import { canParse, isFragment } from './lib/uri.js';
3
+ import { isDidRefAbsolute } from './did-ref.js';
4
+ import { canParse } from './lib/uri.js';
4
5
  import { DID_PLC_PREFIX, DID_WEB_PREFIX, assertDidPlc, assertDidWeb, isDidPlc, isDidWeb, } from './methods.js';
5
6
  import { matchesIdentifier } from './utils.js';
6
7
  export const atprotoDidSchema = z
@@ -72,16 +73,6 @@ function isDidWebWithHttpsPort(did) {
72
73
  did.lastIndexOf('%3A', pathIdx) !== -1;
73
74
  return hasPort;
74
75
  }
75
- export const isAtprotoAudience = (value) => {
76
- if (typeof value !== 'string')
77
- return false;
78
- const hashIndex = value.indexOf('#');
79
- if (hashIndex === -1)
80
- return false;
81
- if (value.indexOf('#', hashIndex + 1) !== -1)
82
- return false;
83
- return (isFragment(value, hashIndex + 1) && isAtprotoDid(value.slice(0, hashIndex)));
84
- };
85
76
  export function extractAtprotoData(document) {
86
77
  return {
87
78
  did: document.id,
@@ -117,4 +108,9 @@ export function isAtprotoVerificationMethod(method) {
117
108
  ATPROTO_VERIFICATION_METHOD_TYPES.includes(method.type) &&
118
109
  matchesIdentifier(this.id, 'atproto', method.id));
119
110
  }
111
+ export function isAtprotoDidRefAbsolute(value) {
112
+ if (!isDidRefAbsolute(value))
113
+ return false;
114
+ return isAtprotoDid(value.slice(0, value.indexOf('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MAAM,UAAU,aAAa,CAAC,QAA4B;IACxD,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,EAAE,IAAI,CACpC,kCAAkC,EAClC,QAAQ,CACT,CAAA;IAED,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,QAAQ,CAChB,QAAQ,CAAC,EAAE,EACX,YAAY,QAAQ,CAAC,EAAE,sDAAsD,EAC7E,uBAAuB,CACxB,CAAA;IACH,CAAC;IAED,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA;AACzC,CAAC;AAGD,MAAM,UAAU,YAAY,CAAC,KAAa;IACxC,OAAO,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;AAClC,CAAC;AAUD,MAAM,UAAU,kCAAkC,CAIhD,OAAsC;IAEtC,OAAO,CACL,OAAO,EAAE,IAAI,KAAK,2BAA2B;QAC7C,OAAO,OAAO,CAAC,eAAe,KAAK,QAAQ;QAC3C,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC;QACjC,iBAAiB,CAAC,IAAI,CAAC,EAAE,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,CAAC,CACtD,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,iCAAiC,GAAG,MAAM,CAAC,MAAM,CAAC;IAC7D,mCAAmC;IACnC,mCAAmC;IACnC,UAAU;CACF,CAAC,CAAA;AAaX,MAAM,UAAU,2BAA2B,CAIzC,MAG6D;IAE7D,OAAO,CACL,OAAO,MAAM,KAAK,QAAQ;QAC1B,OAAO,MAAM,EAAE,kBAAkB,KAAK,QAAQ;QAC7C,iCAAwD,CAAC,QAAQ,CAChE,MAAM,CAAC,IAAI,CACZ;QACD,iBAAiB,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,CAAC,CACjD,CAAA;AACH,CAAC","sourcesContent":["import { z } from 'zod'\nimport { DidDocument, DidService } from './did-document.js'\nimport { DidError, InvalidDidError } from './did-error.js'\nimport { Did } from './did.js'\nimport { canParse, isFragment } from './lib/uri.js'\nimport {\n DID_PLC_PREFIX,\n DID_WEB_PREFIX,\n assertDidPlc,\n assertDidWeb,\n isDidPlc,\n isDidWeb,\n} from './methods.js'\nimport { Identifier, matchesIdentifier } from './utils.js'\n\n// This file contains atproto-specific DID validation utilities.\n\nexport type AtprotoIdentityDidMethods = 'plc' | 'web'\nexport type AtprotoDid = Did<AtprotoIdentityDidMethods>\nexport type AtprotoDidDocument = DidDocument<AtprotoIdentityDidMethods>\n\nexport const atprotoDidSchema = z\n .string()\n .refine(isAtprotoDid, `Atproto only allows \"plc\" and \"web\" DID methods`)\n\nexport function isAtprotoDid(input: unknown): input is AtprotoDid {\n return isDidPlc(input) || isAtprotoDidWeb(input)\n}\n\nexport function asAtprotoDid<T>(input: T) {\n assertAtprotoDid(input)\n return input\n}\n\nexport function assertAtprotoDid(input: unknown): asserts input is AtprotoDid {\n if (typeof input !== 'string') {\n throw new InvalidDidError(typeof input, `DID must be a string`)\n } else if (input.startsWith(DID_PLC_PREFIX)) {\n assertDidPlc(input)\n } else if (input.startsWith(DID_WEB_PREFIX)) {\n assertAtprotoDidWeb(input)\n } else {\n throw new InvalidDidError(\n input,\n `Atproto only allows \"plc\" and \"web\" DID methods`,\n )\n }\n}\n\nexport function assertAtprotoDidWeb(\n input: unknown,\n): asserts input is Did<'web'> {\n assertDidWeb(input)\n\n if (isDidWebWithPath(input)) {\n throw new InvalidDidError(\n input,\n `Atproto does not allow path components in Web DIDs`,\n )\n }\n\n if (isDidWebWithHttpsPort(input)) {\n throw new InvalidDidError(\n input,\n `Atproto does not allow port numbers in Web DIDs, except for localhost`,\n )\n }\n}\n\n/**\n * @see {@link https://atproto.com/specs/did#blessed-did-methods}\n */\nexport function isAtprotoDidWeb(input: unknown): input is Did<'web'> {\n if (!isDidWeb(input)) {\n return false\n }\n\n if (isDidWebWithPath(input)) {\n return false\n }\n\n if (isDidWebWithHttpsPort(input)) {\n return false\n }\n\n return true\n}\n\nfunction isDidWebWithPath(did: Did<'web'>): boolean {\n return did.includes(':', DID_WEB_PREFIX.length)\n}\n\nfunction isLocalhostDid(did: Did<'web'>): boolean {\n return (\n did === 'did:web:localhost' ||\n did.startsWith('did:web:localhost:') ||\n did.startsWith('did:web:localhost%3A')\n )\n}\n\nfunction isDidWebWithHttpsPort(did: Did<'web'>): boolean {\n if (isLocalhostDid(did)) return false\n\n const pathIdx = did.indexOf(':', DID_WEB_PREFIX.length)\n\n const hasPort =\n pathIdx === -1\n ? // No path component, check if there's a port separator anywhere after\n // the \"did:web:\" prefix\n did.includes('%3A', DID_WEB_PREFIX.length)\n : // There is a path component; if there is an encoded colon *before* it,\n // then there is a port number\n did.lastIndexOf('%3A', pathIdx) !== -1\n\n return hasPort\n}\n\nexport type AtprotoAudience = `${AtprotoDid}#${string}`\nexport const isAtprotoAudience = (value: unknown): value is AtprotoAudience => {\n if (typeof value !== 'string') return false\n const hashIndex = value.indexOf('#')\n if (hashIndex === -1) return false\n if (value.indexOf('#', hashIndex + 1) !== -1) return false\n return (\n isFragment(value, hashIndex + 1) && isAtprotoDid(value.slice(0, hashIndex))\n )\n}\n\nexport type AtprotoData<\n M extends AtprotoIdentityDidMethods = AtprotoIdentityDidMethods,\n> = {\n did: Did<M>\n aka?: string\n key?: AtprotoVerificationMethod<M>\n pds?: AtprotoPersonalDataServerService<M>\n}\n\nexport function extractAtprotoData<M extends AtprotoIdentityDidMethods>(\n document: DidDocument<M>,\n): AtprotoData<M> {\n return {\n did: document.id,\n aka: document.alsoKnownAs?.find(isAtprotoAka)?.slice(5),\n key: document.verificationMethod?.find(\n isAtprotoVerificationMethod<M>,\n document,\n ),\n pds: document.service?.find(\n isAtprotoPersonalDataServerService<M>,\n document,\n ),\n }\n}\n\nexport function extractPdsUrl(document: AtprotoDidDocument): URL {\n const service = document.service?.find(\n isAtprotoPersonalDataServerService,\n document,\n )\n\n if (!service) {\n throw new DidError(\n document.id,\n `Document ${document.id} does not contain a (valid) #atproto_pds service URL`,\n 'did-service-not-found',\n )\n }\n\n return new URL(service.serviceEndpoint)\n}\n\nexport type AtprotoAka = `at://${string}`\nexport function isAtprotoAka(value: string): value is AtprotoAka {\n return value.startsWith('at://')\n}\n\nexport type AtprotoPersonalDataServerService<\n M extends AtprotoIdentityDidMethods = AtprotoIdentityDidMethods,\n> = DidService & {\n id: Identifier<Did<M>, 'atproto_pds'>\n type: 'AtprotoPersonalDataServer'\n serviceEndpoint: string\n}\n\nexport function isAtprotoPersonalDataServerService<\n M extends AtprotoIdentityDidMethods = AtprotoIdentityDidMethods,\n>(\n this: DidDocument<M>,\n service: null | undefined | DidService,\n): service is AtprotoPersonalDataServerService<M> {\n return (\n service?.type === 'AtprotoPersonalDataServer' &&\n typeof service.serviceEndpoint === 'string' &&\n canParse(service.serviceEndpoint) &&\n matchesIdentifier(this.id, 'atproto_pds', service.id)\n )\n}\n\nexport const ATPROTO_VERIFICATION_METHOD_TYPES = Object.freeze([\n 'EcdsaSecp256r1VerificationKey2019',\n 'EcdsaSecp256k1VerificationKey2019',\n 'Multikey',\n] as const)\nexport type SupportedAtprotoVerificationMethodType =\n (typeof ATPROTO_VERIFICATION_METHOD_TYPES)[number]\n\ntype VerificationMethod = NonNullable<DidDocument['verificationMethod']>[number]\nexport type AtprotoVerificationMethod<\n M extends AtprotoIdentityDidMethods = AtprotoIdentityDidMethods,\n> = Extract<VerificationMethod, object> & {\n id: Identifier<Did<M>, 'atproto'>\n type: SupportedAtprotoVerificationMethodType\n publicKeyMultibase: string\n}\n\nexport function isAtprotoVerificationMethod<\n M extends AtprotoIdentityDidMethods = AtprotoIdentityDidMethods,\n>(\n this: DidDocument<M>,\n method:\n | null\n | undefined\n | NonNullable<DidDocument<M>['verificationMethod']>[number],\n): method is AtprotoVerificationMethod<M> {\n return (\n typeof method === 'object' &&\n typeof method?.publicKeyMultibase === 'string' &&\n (ATPROTO_VERIFICATION_METHOD_TYPES as readonly unknown[]).includes(\n method.type,\n ) &&\n matches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O,CACL,OAAO,EAAE,IAAI,KAAK,2BAA2B;QAC7C,OAAO,OAAO,CAAC,eAAe,KAAK,QAAQ;QAC3C,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC;QACjC,iBAAiB,CAAC,IAAI,CAAC,EAAE,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,CAAC,CACtD,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,iCAAiC,GAAG,MAAM,CAAC,MAAM,CAAC;IAC7D,mCAAmC;IACnC,mCAAmC;IACnC,UAAU;CACF,CAAC,CAAA;AAaX,MAAM,UAAU,2BAA2B,CAIzC,MAG6D;IAE7D,OAAO,CACL,OAAO,MAAM,KAAK,QAAQ;QAC1B,OAAO,MAAM,EAAE,kBAAkB,KAAK,QAAQ;QAC7C,iCAAwD,CAAC,QAAQ,CAChE,MAAM,CAAC,IAAI,CACZ;QACD,iBAAiB,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,CAAC,CACjD,CAAA;AACH,CAAC;AAOD,MAAM,UAAU,uBAAuB,CACrC,KAAc;IAEd,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAA;IAC1C,OAAO,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;AACzD,CAAC","sourcesContent":["import { z } from 'zod'\nimport { DidDocument, DidService } from './did-document.js'\nimport { DidError, InvalidDidError } from './did-error.js'\nimport { DidRefAbsolute, isDidRefAbsolute } from './did-ref.js'\nimport { Did } from './did.js'\nimport { canParse } from './lib/uri.js'\nimport {\n DID_PLC_PREFIX,\n DID_WEB_PREFIX,\n assertDidPlc,\n assertDidWeb,\n isDidPlc,\n isDidWeb,\n} from './methods.js'\nimport { Identifier, matchesIdentifier } from './utils.js'\n\n// This file contains atproto-specific DID validation utilities.\n\nexport type AtprotoIdentityDidMethods = 'plc' | 'web'\nexport type AtprotoDid = Did<AtprotoIdentityDidMethods>\nexport type AtprotoDidDocument = DidDocument<AtprotoIdentityDidMethods>\n\nexport const atprotoDidSchema = z\n .string()\n .refine(isAtprotoDid, `Atproto only allows \"plc\" and \"web\" DID methods`)\n\nexport function isAtprotoDid(input: unknown): input is AtprotoDid {\n return isDidPlc(input) || isAtprotoDidWeb(input)\n}\n\nexport function asAtprotoDid<T>(input: T) {\n assertAtprotoDid(input)\n return input\n}\n\nexport function assertAtprotoDid(input: unknown): asserts input is AtprotoDid {\n if (typeof input !== 'string') {\n throw new InvalidDidError(typeof input, `DID must be a string`)\n } else if (input.startsWith(DID_PLC_PREFIX)) {\n assertDidPlc(input)\n } else if (input.startsWith(DID_WEB_PREFIX)) {\n assertAtprotoDidWeb(input)\n } else {\n throw new InvalidDidError(\n input,\n `Atproto only allows \"plc\" and \"web\" DID methods`,\n )\n }\n}\n\nexport function assertAtprotoDidWeb(\n input: unknown,\n): asserts input is Did<'web'> {\n assertDidWeb(input)\n\n if (isDidWebWithPath(input)) {\n throw new InvalidDidError(\n input,\n `Atproto does not allow path components in Web DIDs`,\n )\n }\n\n if (isDidWebWithHttpsPort(input)) {\n throw new InvalidDidError(\n input,\n `Atproto does not allow port numbers in Web DIDs, except for localhost`,\n )\n }\n}\n\n/**\n * @see {@link https://atproto.com/specs/did#blessed-did-methods}\n */\nexport function isAtprotoDidWeb(input: unknown): input is Did<'web'> {\n if (!isDidWeb(input)) {\n return false\n }\n\n if (isDidWebWithPath(input)) {\n return false\n }\n\n if (isDidWebWithHttpsPort(input)) {\n return false\n }\n\n return true\n}\n\nfunction isDidWebWithPath(did: Did<'web'>): boolean {\n return did.includes(':', DID_WEB_PREFIX.length)\n}\n\nfunction isLocalhostDid(did: Did<'web'>): boolean {\n return (\n did === 'did:web:localhost' ||\n did.startsWith('did:web:localhost:') ||\n did.startsWith('did:web:localhost%3A')\n )\n}\n\nfunction isDidWebWithHttpsPort(did: Did<'web'>): boolean {\n if (isLocalhostDid(did)) return false\n\n const pathIdx = did.indexOf(':', DID_WEB_PREFIX.length)\n\n const hasPort =\n pathIdx === -1\n ? // No path component, check if there's a port separator anywhere after\n // the \"did:web:\" prefix\n did.includes('%3A', DID_WEB_PREFIX.length)\n : // There is a path component; if there is an encoded colon *before* it,\n // then there is a port number\n did.lastIndexOf('%3A', pathIdx) !== -1\n\n return hasPort\n}\n\nexport type AtprotoData<\n M extends AtprotoIdentityDidMethods = AtprotoIdentityDidMethods,\n> = {\n did: Did<M>\n aka?: string\n key?: AtprotoVerificationMethod<M>\n pds?: AtprotoPersonalDataServerService<M>\n}\n\nexport function extractAtprotoData<M extends AtprotoIdentityDidMethods>(\n document: DidDocument<M>,\n): AtprotoData<M> {\n return {\n did: document.id,\n aka: document.alsoKnownAs?.find(isAtprotoAka)?.slice(5),\n key: document.verificationMethod?.find(\n isAtprotoVerificationMethod<M>,\n document,\n ),\n pds: document.service?.find(\n isAtprotoPersonalDataServerService<M>,\n document,\n ),\n }\n}\n\nexport function extractPdsUrl(document: AtprotoDidDocument): URL {\n const service = document.service?.find(\n isAtprotoPersonalDataServerService,\n document,\n )\n\n if (!service) {\n throw new DidError(\n document.id,\n `Document ${document.id} does not contain a (valid) #atproto_pds service URL`,\n 'did-service-not-found',\n )\n }\n\n return new URL(service.serviceEndpoint)\n}\n\nexport type AtprotoAka = `at://${string}`\nexport function isAtprotoAka(value: string): value is AtprotoAka {\n return value.startsWith('at://')\n}\n\nexport type AtprotoPersonalDataServerService<\n M extends AtprotoIdentityDidMethods = AtprotoIdentityDidMethods,\n> = DidService & {\n id: Identifier<Did<M>, 'atproto_pds'>\n type: 'AtprotoPersonalDataServer'\n serviceEndpoint: string\n}\n\nexport function isAtprotoPersonalDataServerService<\n M extends AtprotoIdentityDidMethods = AtprotoIdentityDidMethods,\n>(\n this: DidDocument<M>,\n service: null | undefined | DidService,\n): service is AtprotoPersonalDataServerService<M> {\n return (\n service?.type === 'AtprotoPersonalDataServer' &&\n typeof service.serviceEndpoint === 'string' &&\n canParse(service.serviceEndpoint) &&\n matchesIdentifier(this.id, 'atproto_pds', service.id)\n )\n}\n\nexport const ATPROTO_VERIFICATION_METHOD_TYPES = Object.freeze([\n 'EcdsaSecp256r1VerificationKey2019',\n 'EcdsaSecp256k1VerificationKey2019',\n 'Multikey',\n] as const)\nexport type SupportedAtprotoVerificationMethodType =\n (typeof ATPROTO_VERIFICATION_METHOD_TYPES)[number]\n\ntype VerificationMethod = NonNullable<DidDocument['verificationMethod']>[number]\nexport type AtprotoVerificationMethod<\n M extends AtprotoIdentityDidMethods = AtprotoIdentityDidMethods,\n> = Extract<VerificationMethod, object> & {\n id: Identifier<Did<M>, 'atproto'>\n type: SupportedAtprotoVerificationMethodType\n publicKeyMultibase: string\n}\n\nexport function isAtprotoVerificationMethod<\n M extends AtprotoIdentityDidMethods = AtprotoIdentityDidMethods,\n>(\n this: DidDocument<M>,\n method:\n | null\n | undefined\n | NonNullable<DidDocument<M>['verificationMethod']>[number],\n): method is AtprotoVerificationMethod<M> {\n return (\n typeof method === 'object' &&\n typeof method?.publicKeyMultibase === 'string' &&\n (ATPROTO_VERIFICATION_METHOD_TYPES as readonly unknown[]).includes(\n method.type,\n ) &&\n matchesIdentifier(this.id, 'atproto', method.id)\n )\n}\n\n/**\n * An atproto-constrained absolute DID reference: `${AtprotoDid}#${fragment}`.\n */\nexport type AtprotoDidRefAbsolute = DidRefAbsolute<AtprotoIdentityDidMethods>\n\nexport function isAtprotoDidRefAbsolute(\n value: unknown,\n): value is AtprotoDidRefAbsolute {\n if (!isDidRefAbsolute(value)) return false\n return isAtprotoDid(value.slice(0, value.indexOf('#')))\n}\n"]}
@@ -0,0 +1,15 @@
1
+ import { Did } from './did.js';
2
+ /**
3
+ * An absolute DID reference: `${Did}#${fragment}`.
4
+ *
5
+ * @see {@link https://www.w3.org/TR/did-core/#did-url-syntax}
6
+ */
7
+ export type DidRefAbsolute<M extends string = string> = `${Did<M>}#${string}`;
8
+ export declare const isDidRefAbsolute: (value: unknown) => value is DidRefAbsolute;
9
+ /**
10
+ * A relative DID reference (a `#fragment` resolved against the surrounding
11
+ * DID document's `id`). The optional `id` parameter narrows the fragment.
12
+ */
13
+ export type DidRefRelative<I extends string = string> = `#${I}`;
14
+ export declare function isDidRefRelative<I extends string = string>(value: unknown, id?: I): value is DidRefRelative<I>;
15
+ //# sourceMappingURL=did-ref.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"did-ref.d.ts","sourceRoot":"","sources":["../src/did-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAS,MAAM,UAAU,CAAA;AAGrC;;;;GAIG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAA;AAE7E,eAAO,MAAM,gBAAgB,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,cAO1D,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,IAAI,CAAC,EAAE,CAAA;AAE/D,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EACxD,KAAK,EAAE,OAAO,EACd,EAAE,CAAC,EAAE,CAAC,GACL,KAAK,IAAI,cAAc,CAAC,CAAC,CAAC,CAQ5B"}
@@ -0,0 +1,30 @@
1
+ import { isDid } from './did.js';
2
+ import { isFragment } from './lib/uri.js';
3
+ export const isDidRefAbsolute = (value) => {
4
+ if (typeof value !== 'string')
5
+ return false;
6
+ const hashIndex = value.indexOf('#');
7
+ if (hashIndex === -1)
8
+ return false; // no '#'
9
+ if (hashIndex === value.length - 1)
10
+ return false; // empty fragment
11
+ if (value.includes('#', hashIndex + 1))
12
+ return false; // more than one '#'
13
+ return isFragment(value, hashIndex + 1) && isDid(value.slice(0, hashIndex));
14
+ };
15
+ export function isDidRefRelative(value, id) {
16
+ if (typeof value !== 'string')
17
+ return false;
18
+ if (value.charCodeAt(0) !== 35 /* '#' */)
19
+ return false; // doesn't start with '#'
20
+ if (value.length < 2)
21
+ return false; // empty fragment
22
+ if (value.includes('#', 1))
23
+ return false; // more than one '#'
24
+ if (!isFragment(value, 1))
25
+ return false;
26
+ if (id !== undefined && value !== `#${id}`)
27
+ return false; // id mismatch
28
+ return true;
29
+ }
30
+ //# sourceMappingURL=did-ref.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"did-ref.js","sourceRoot":"","sources":["../src/did-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AASzC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAc,EAA2B,EAAE;IAC1E,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC3C,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IACpC,IAAI,SAAS,KAAK,CAAC,CAAC;QAAE,OAAO,KAAK,CAAA,CAAC,SAAS;IAC5C,IAAI,SAAS,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,KAAK,CAAA,CAAC,iBAAiB;IAClE,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,SAAS,GAAG,CAAC,CAAC;QAAE,OAAO,KAAK,CAAA,CAAC,oBAAoB;IACzE,OAAO,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAA;AAC7E,CAAC,CAAA;AAQD,MAAM,UAAU,gBAAgB,CAC9B,KAAc,EACd,EAAM;IAEN,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC3C,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,SAAS;QAAE,OAAO,KAAK,CAAA,CAAC,yBAAyB;IAChF,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,KAAK,CAAA,CAAC,iBAAiB;IACpD,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC;QAAE,OAAO,KAAK,CAAA,CAAC,oBAAoB;IAC7D,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC;QAAE,OAAO,KAAK,CAAA;IACvC,IAAI,EAAE,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,EAAE;QAAE,OAAO,KAAK,CAAA,CAAC,cAAc;IACvE,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["import { Did, isDid } from './did.js'\nimport { isFragment } from './lib/uri.js'\n\n/**\n * An absolute DID reference: `${Did}#${fragment}`.\n *\n * @see {@link https://www.w3.org/TR/did-core/#did-url-syntax}\n */\nexport type DidRefAbsolute<M extends string = string> = `${Did<M>}#${string}`\n\nexport const isDidRefAbsolute = (value: unknown): value is DidRefAbsolute => {\n if (typeof value !== 'string') return false\n const hashIndex = value.indexOf('#')\n if (hashIndex === -1) return false // no '#'\n if (hashIndex === value.length - 1) return false // empty fragment\n if (value.includes('#', hashIndex + 1)) return false // more than one '#'\n return isFragment(value, hashIndex + 1) && isDid(value.slice(0, hashIndex))\n}\n\n/**\n * A relative DID reference (a `#fragment` resolved against the surrounding\n * DID document's `id`). The optional `id` parameter narrows the fragment.\n */\nexport type DidRefRelative<I extends string = string> = `#${I}`\n\nexport function isDidRefRelative<I extends string = string>(\n value: unknown,\n id?: I,\n): value is DidRefRelative<I> {\n if (typeof value !== 'string') return false\n if (value.charCodeAt(0) !== 35 /* '#' */) return false // doesn't start with '#'\n if (value.length < 2) return false // empty fragment\n if (value.includes('#', 1)) return false // more than one '#'\n if (!isFragment(value, 1)) return false\n if (id !== undefined && value !== `#${id}`) return false // id mismatch\n return true\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from './atproto.js';
2
2
  export * from './did-document.js';
3
3
  export * from './did-error.js';
4
+ export * from './did-ref.js';
4
5
  export * from './did.js';
5
6
  export * from './methods.js';
6
7
  export * from './utils.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA"}
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from './atproto.js';
2
2
  export * from './did-document.js';
3
3
  export * from './did-error.js';
4
+ export * from './did-ref.js';
4
5
  export * from './did.js';
5
6
  export * from './methods.js';
6
7
  export * from './utils.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA","sourcesContent":["export * from './atproto.js'\nexport * from './did-document.js'\nexport * from './did-error.js'\nexport * from './did.js'\nexport * from './methods.js'\nexport * from './utils.js'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA","sourcesContent":["export * from './atproto.js'\nexport * from './did-document.js'\nexport * from './did-error.js'\nexport * from './did-ref.js'\nexport * from './did.js'\nexport * from './methods.js'\nexport * from './utils.js'\n"]}
package/jest.config.cjs CHANGED
@@ -4,12 +4,19 @@ module.exports = {
4
4
  transform: {
5
5
  '^.+\\.(t|j)s$': [
6
6
  '@swc/jest',
7
- { jsc: { transform: {} }, module: { type: 'es6' } },
7
+ {
8
+ jsc: {
9
+ parser: { syntax: 'typescript', importAttributes: true },
10
+ experimental: { keepImportAttributes: true },
11
+ transform: {},
12
+ },
13
+ module: { type: 'es6' },
14
+ },
8
15
  ],
9
16
  },
10
17
  extensionsToTreatAsEsm: ['.ts'],
11
18
  transformIgnorePatterns: [],
12
19
  testTimeout: 60000,
13
- setupFiles: ['<rootDir>/../../jest.setup.ts'],
20
+ setupFiles: ['<rootDir>/../../test.setup.ts'],
14
21
  moduleNameMapper: { '^(\\.\\.?\\/.+)\\.js$': ['$1.ts', '$1.js'] },
15
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/did",
3
- "version": "0.4.0-next.0",
3
+ "version": "0.5.0",
4
4
  "engines": {
5
5
  "node": ">=22"
6
6
  },
package/src/atproto.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import { z } from 'zod'
2
2
  import { DidDocument, DidService } from './did-document.js'
3
3
  import { DidError, InvalidDidError } from './did-error.js'
4
+ import { DidRefAbsolute, isDidRefAbsolute } from './did-ref.js'
4
5
  import { Did } from './did.js'
5
- import { canParse, isFragment } from './lib/uri.js'
6
+ import { canParse } from './lib/uri.js'
6
7
  import {
7
8
  DID_PLC_PREFIX,
8
9
  DID_WEB_PREFIX,
@@ -115,17 +116,6 @@ function isDidWebWithHttpsPort(did: Did<'web'>): boolean {
115
116
  return hasPort
116
117
  }
117
118
 
118
- export type AtprotoAudience = `${AtprotoDid}#${string}`
119
- export const isAtprotoAudience = (value: unknown): value is AtprotoAudience => {
120
- if (typeof value !== 'string') return false
121
- const hashIndex = value.indexOf('#')
122
- if (hashIndex === -1) return false
123
- if (value.indexOf('#', hashIndex + 1) !== -1) return false
124
- return (
125
- isFragment(value, hashIndex + 1) && isAtprotoDid(value.slice(0, hashIndex))
126
- )
127
- }
128
-
129
119
  export type AtprotoData<
130
120
  M extends AtprotoIdentityDidMethods = AtprotoIdentityDidMethods,
131
121
  > = {
@@ -231,3 +221,15 @@ export function isAtprotoVerificationMethod<
231
221
  matchesIdentifier(this.id, 'atproto', method.id)
232
222
  )
233
223
  }
224
+
225
+ /**
226
+ * An atproto-constrained absolute DID reference: `${AtprotoDid}#${fragment}`.
227
+ */
228
+ export type AtprotoDidRefAbsolute = DidRefAbsolute<AtprotoIdentityDidMethods>
229
+
230
+ export function isAtprotoDidRefAbsolute(
231
+ value: unknown,
232
+ ): value is AtprotoDidRefAbsolute {
233
+ if (!isDidRefAbsolute(value)) return false
234
+ return isAtprotoDid(value.slice(0, value.indexOf('#')))
235
+ }
package/src/did-ref.ts ADDED
@@ -0,0 +1,37 @@
1
+ import { Did, isDid } from './did.js'
2
+ import { isFragment } from './lib/uri.js'
3
+
4
+ /**
5
+ * An absolute DID reference: `${Did}#${fragment}`.
6
+ *
7
+ * @see {@link https://www.w3.org/TR/did-core/#did-url-syntax}
8
+ */
9
+ export type DidRefAbsolute<M extends string = string> = `${Did<M>}#${string}`
10
+
11
+ export const isDidRefAbsolute = (value: unknown): value is DidRefAbsolute => {
12
+ if (typeof value !== 'string') return false
13
+ const hashIndex = value.indexOf('#')
14
+ if (hashIndex === -1) return false // no '#'
15
+ if (hashIndex === value.length - 1) return false // empty fragment
16
+ if (value.includes('#', hashIndex + 1)) return false // more than one '#'
17
+ return isFragment(value, hashIndex + 1) && isDid(value.slice(0, hashIndex))
18
+ }
19
+
20
+ /**
21
+ * A relative DID reference (a `#fragment` resolved against the surrounding
22
+ * DID document's `id`). The optional `id` parameter narrows the fragment.
23
+ */
24
+ export type DidRefRelative<I extends string = string> = `#${I}`
25
+
26
+ export function isDidRefRelative<I extends string = string>(
27
+ value: unknown,
28
+ id?: I,
29
+ ): value is DidRefRelative<I> {
30
+ if (typeof value !== 'string') return false
31
+ if (value.charCodeAt(0) !== 35 /* '#' */) return false // doesn't start with '#'
32
+ if (value.length < 2) return false // empty fragment
33
+ if (value.includes('#', 1)) return false // more than one '#'
34
+ if (!isFragment(value, 1)) return false
35
+ if (id !== undefined && value !== `#${id}`) return false // id mismatch
36
+ return true
37
+ }
package/src/index.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from './atproto.js'
2
2
  export * from './did-document.js'
3
3
  export * from './did-error.js'
4
+ export * from './did-ref.js'
4
5
  export * from './did.js'
5
6
  export * from './methods.js'
6
7
  export * from './utils.js'
@@ -0,0 +1,69 @@
1
+ import { isAtprotoDidRefAbsolute } from '../src/atproto.js'
2
+ import { isDidRefRelative } from '../src/did-ref.js'
3
+
4
+ describe('isAtprotoDidRefAbsolute', () => {
5
+ it('accepts well-formed absolute references', () => {
6
+ expect(
7
+ isAtprotoDidRefAbsolute('did:plc:l3rouwludahu3ui3bt66mfvj#atproto'),
8
+ ).toBe(true)
9
+ expect(isAtprotoDidRefAbsolute('did:web:example.com#service_id')).toBe(true)
10
+ expect(isAtprotoDidRefAbsolute('did:web:example.com#atproto_label')).toBe(
11
+ true,
12
+ )
13
+ })
14
+
15
+ it('rejects bare DIDs', () => {
16
+ expect(isAtprotoDidRefAbsolute('did:plc:l3rouwludahu3ui3bt66mfvj')).toBe(
17
+ false,
18
+ )
19
+ expect(isAtprotoDidRefAbsolute('did:web:example.com')).toBe(false)
20
+ })
21
+
22
+ it('rejects relative references', () => {
23
+ expect(isAtprotoDidRefAbsolute('#atproto')).toBe(false)
24
+ })
25
+
26
+ it('rejects malformed input', () => {
27
+ expect(isAtprotoDidRefAbsolute('')).toBe(false)
28
+ expect(isAtprotoDidRefAbsolute('did:plc:l3rouwludahu3ui3bt66mfvj#')).toBe(
29
+ false,
30
+ )
31
+ expect(
32
+ isAtprotoDidRefAbsolute('did:plc:l3rouwludahu3ui3bt66mfvj##foo'),
33
+ ).toBe(false)
34
+ expect(
35
+ isAtprotoDidRefAbsolute('did:plc:l3rouwludahu3ui3bt66mfvj#a#b'),
36
+ ).toBe(false)
37
+ expect(isAtprotoDidRefAbsolute('did:foo:bar#baz')).toBe(false)
38
+ expect(isAtprotoDidRefAbsolute(null)).toBe(false)
39
+ expect(isAtprotoDidRefAbsolute(123)).toBe(false)
40
+ })
41
+ })
42
+
43
+ describe('isDidRefRelative', () => {
44
+ it('accepts well-formed relative references', () => {
45
+ expect(isDidRefRelative('#atproto')).toBe(true)
46
+ expect(isDidRefRelative('#atproto_label')).toBe(true)
47
+ expect(isDidRefRelative('#a')).toBe(true)
48
+ })
49
+
50
+ it('narrows on a specific id when supplied', () => {
51
+ expect(isDidRefRelative('#atproto', 'atproto')).toBe(true)
52
+ expect(isDidRefRelative('#atproto_label', 'atproto')).toBe(false)
53
+ })
54
+
55
+ it('rejects absolute references and bare strings', () => {
56
+ expect(isDidRefRelative('did:plc:l3rouwludahu3ui3bt66mfvj#atproto')).toBe(
57
+ false,
58
+ )
59
+ expect(isDidRefRelative('atproto')).toBe(false)
60
+ })
61
+
62
+ it('rejects malformed input', () => {
63
+ expect(isDidRefRelative('')).toBe(false)
64
+ expect(isDidRefRelative('#')).toBe(false)
65
+ expect(isDidRefRelative('#a#b')).toBe(false)
66
+ expect(isDidRefRelative(null)).toBe(false)
67
+ expect(isDidRefRelative(123)).toBe(false)
68
+ })
69
+ })
@@ -1 +1 @@
1
- {"root":["./src/atproto.ts","./src/did-document.ts","./src/did-error.ts","./src/did.ts","./src/index.ts","./src/methods.ts","./src/utils.ts","./src/lib/uri.ts","./src/methods/plc.ts","./src/methods/web.ts"],"version":"6.0.3"}
1
+ {"root":["./src/atproto.ts","./src/did-document.ts","./src/did-error.ts","./src/did-ref.ts","./src/did.ts","./src/index.ts","./src/methods.ts","./src/utils.ts","./src/lib/uri.ts","./src/methods/plc.ts","./src/methods/web.ts"],"version":"6.0.3"}