@atproto-labs/identity-resolver 0.4.0-next.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,24 +1,32 @@
|
|
|
1
1
|
# @atproto-labs/identity-resolver
|
|
2
2
|
|
|
3
|
-
## 0.4.
|
|
3
|
+
## 0.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#4967](https://github.com/bluesky-social/atproto/pull/4967) [`9fc720c`](https://github.com/bluesky-social/atproto/commit/9fc720ce75f3ee88a5e48a9be919b07c7647f6f5) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Use TypeScript 7 to build package
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`9fc720c`](https://github.com/bluesky-social/atproto/commit/9fc720ce75f3ee88a5e48a9be919b07c7647f6f5)]:
|
|
10
|
+
- @atproto-labs/handle-resolver@0.4.2
|
|
11
|
+
- @atproto-labs/did-resolver@0.3.2
|
|
12
|
+
|
|
13
|
+
## 0.4.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
|
6
16
|
|
|
7
|
-
- [#4929](https://github.com/bluesky-social/atproto/pull/4929) [`
|
|
17
|
+
- [#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.
|
|
8
18
|
|
|
9
|
-
- [#4943](https://github.com/bluesky-social/atproto/pull/4943) [`
|
|
19
|
+
- [#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.
|
|
10
20
|
|
|
11
21
|
Node.js 22's `require()` compatibility layer can still load these packages in CommonJS code.
|
|
12
22
|
|
|
13
|
-
- [#4930](https://github.com/bluesky-social/atproto/pull/4930) [`
|
|
14
|
-
|
|
15
|
-
Internal: tsconfig `moduleResolution: "node"` is silenced via `ignoreDeprecations: "6.0"` for now; the proper migration to `node16`/`bundler` resolution is deferred.
|
|
23
|
+
- [#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
24
|
|
|
17
25
|
### Patch Changes
|
|
18
26
|
|
|
19
|
-
- Updated dependencies [[`
|
|
20
|
-
- @atproto-labs/did-resolver@0.3.0
|
|
21
|
-
- @atproto-labs/handle-resolver@0.4.0
|
|
27
|
+
- Updated dependencies [[`f01c59f`](https://github.com/bluesky-social/atproto/commit/f01c59f5bd3f75fb8b47a9eecd4858b84033fb7c), [`c459153`](https://github.com/bluesky-social/atproto/commit/c459153395a30ce89e050892c8fab7dc98e019b9), [`908bece`](https://github.com/bluesky-social/atproto/commit/908bece169258bff5ad121e5eec157d6ded6f705)]:
|
|
28
|
+
- @atproto-labs/did-resolver@0.3.0
|
|
29
|
+
- @atproto-labs/handle-resolver@0.4.0
|
|
22
30
|
|
|
23
31
|
## 0.3.6
|
|
24
32
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atproto-identity-resolver.d.ts","sourceRoot":"","sources":["../src/atproto-identity-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,yBAAyB,EACzB,WAAW,EACX,WAAW,EACX,iBAAiB,EAElB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACL,cAAc,EACd,oBAAoB,EACrB,MAAM,+BAA+B,CAAA;AAGtC,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,sBAAs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CAAC,CAEjD;IAEY,qBAAqB,CAChC,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,WAAW,CAAC,yBAAyB,CAAC,CAAC,CA6BjD;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atproto-identity-resolver.js","sourceRoot":"","sources":["../src/atproto-identity-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,YAAY,GACb,MAAM,4BAA4B,CAAA;AAKnC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAMpE,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAA;AAEvE,mEAAmE;AACnE,4CAA4C;AAC5C,iDAAiD;AAEjD;;;;;GAKG;AACH,MAAM,OAAO,uBAAuB;IAClC,YACqB,WAAmD,EACnD,cAA8B;
|
|
1
|
+
{"version":3,"file":"atproto-identity-resolver.js","sourceRoot":"","sources":["../src/atproto-identity-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,YAAY,GACb,MAAM,4BAA4B,CAAA;AAKnC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAMpE,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAA;AAEvE,mEAAmE;AACnE,4CAA4C;AAC5C,iDAAiD;AAEjD;;;;;GAKG;AACH,MAAM,OAAO,uBAAuB;IAClC,YACqB,WAAmD,EACnD,cAA8B;2BAD9B,WAAW;8BACX,cAAc;IAChC,CAAC;IAEG,KAAK,CAAC,OAAO,CAClB,KAAa,EACb,OAAgC;QAEhC,OAAO,YAAY,CAAC,KAAK,CAAC;YACxB,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC;YACrC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,qBAAqB,CAChC,KAAa,EACb,OAA8B;QAE9B,MAAM,MAAM,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAA;QACxC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,qBAAqB,CAAC,mBAAmB,KAAK,aAAa,CAAC,CAAA;QACxE,CAAC;QAED,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QAE9D,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,MAAM,IAAI,qBAAqB,CAC7B,WAAW,MAAM,6BAA6B,CAC/C,CAAA;QACH,CAAC;QAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA;QAEjC,2EAA2E;QAC3E,4CAA4C;QAE5C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;QAE7D,oCAAoC;QACpC,IAAI,MAAM,KAAK,uBAAuB,CAAC,QAAQ,CAAC,EAAE,CAAC;YACjD,MAAM,IAAI,qBAAqB,CAC7B,qBAAqB,GAAG,kCAAkC,MAAM,GAAG,CACpE,CAAA;QACH,CAAC;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF","sourcesContent":["import {\n AtprotoDid,\n AtprotoIdentityDidMethods,\n DidDocument,\n DidResolver,\n ResolveDidOptions,\n isAtprotoDid,\n} from '@atproto-labs/did-resolver'\nimport {\n HandleResolver,\n ResolveHandleOptions,\n} from '@atproto-labs/handle-resolver'\nimport { HANDLE_INVALID } from './constants.js'\nimport { IdentityResolverError } from './identity-resolver-error.js'\nimport {\n IdentityInfo,\n IdentityResolver,\n ResolveIdentityOptions,\n} from './identity-resolver.js'\nimport { asNormalizedHandle, extractNormalizedHandle } from './util.js'\n\n// @TODO Move this to its own package as soon as we have a distinct\n// implementation based on XRPC calls to the\n// \"com.atproto.identity.resolveIdentity\" method.\n\n/**\n * Implementation of the official ATPROTO identity resolution strategy.\n * This implementation relies on two primitives:\n * - DID resolution (using the `DidResolver` interface)\n * - Handle resolution (using the `HandleResolver` interface)\n */\nexport class AtprotoIdentityResolver implements IdentityResolver {\n constructor(\n protected readonly didResolver: DidResolver<AtprotoIdentityDidMethods>,\n protected readonly handleResolver: HandleResolver,\n ) {}\n\n public async resolve(\n input: string,\n options?: ResolveIdentityOptions,\n ): Promise<IdentityInfo> {\n return isAtprotoDid(input)\n ? this.resolveFromDid(input, options)\n : this.resolveFromHandle(input, options)\n }\n\n public async resolveFromDid(\n did: AtprotoDid,\n options?: ResolveDidOptions,\n ): Promise<IdentityInfo> {\n const document = await this.getDocumentFromDid(did, options)\n\n options?.signal?.throwIfAborted()\n\n // We will only return the document's handle alias if it resolves to the\n // same DID as the input.\n const handle = extractNormalizedHandle(document)\n const resolvedDid = handle\n ? await this.handleResolver\n .resolve(handle, options)\n .catch(() => undefined) // Ignore errors (temporarily unavailable)\n : undefined\n\n return {\n did: document.id,\n didDoc: document,\n handle: handle && resolvedDid === did ? handle : HANDLE_INVALID,\n }\n }\n\n public async resolveFromHandle(\n handle: string,\n options?: ResolveHandleOptions,\n ): Promise<IdentityInfo> {\n const document = await this.getDocumentFromHandle(handle, options)\n\n // @NOTE bi-directional resolution enforced in getDocumentFromHandle()\n\n return {\n did: document.id,\n didDoc: document,\n handle: extractNormalizedHandle(document) || HANDLE_INVALID,\n }\n }\n\n public async getDocumentFromDid(\n did: AtprotoDid,\n options?: ResolveDidOptions,\n ): Promise<DidDocument<AtprotoIdentityDidMethods>> {\n return this.didResolver.resolve(did, options)\n }\n\n public async getDocumentFromHandle(\n input: string,\n options?: ResolveHandleOptions,\n ): Promise<DidDocument<AtprotoIdentityDidMethods>> {\n const handle = asNormalizedHandle(input)\n if (!handle) {\n throw new IdentityResolverError(`Invalid handle \"${input}\" provided.`)\n }\n\n const did = await this.handleResolver.resolve(handle, options)\n\n if (!did) {\n throw new IdentityResolverError(\n `Handle \"${handle}\" does not resolve to a DID`,\n )\n }\n\n options?.signal?.throwIfAborted()\n\n // Note: Not using \"return this.resolveDid(did, options)\" to make the extra\n // check for the handle in the DID document:\n\n const document = await this.didResolver.resolve(did, options)\n\n // Enforce bi-directional resolution\n if (handle !== extractNormalizedHandle(document)) {\n throw new IdentityResolverError(\n `Did document for \"${did}\" does not include the handle \"${handle}\"`,\n )\n }\n\n return document\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto-labs/identity-resolver",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=22"
|
|
6
6
|
},
|
|
@@ -26,13 +26,11 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@atproto-labs/
|
|
30
|
-
"@atproto-labs/
|
|
31
|
-
},
|
|
32
|
-
"devDependencies": {
|
|
33
|
-
"typescript": "^6.0.3"
|
|
29
|
+
"@atproto-labs/handle-resolver": "^0.4.2",
|
|
30
|
+
"@atproto-labs/did-resolver": "^0.3.2"
|
|
34
31
|
},
|
|
32
|
+
"devDependencies": {},
|
|
35
33
|
"scripts": {
|
|
36
|
-
"build": "
|
|
34
|
+
"build": "tsgo --build tsconfig.json"
|
|
37
35
|
}
|
|
38
36
|
}
|
package/tsconfig.build.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/atproto-identity-resolver.ts","./src/constants.ts","./src/create-identity-resolver.ts","./src/identity-resolver-error.ts","./src/identity-resolver.ts","./src/index.ts","./src/util.ts"]
|
|
1
|
+
{"version":"7.0.0-dev.20260614.1","root":["./src/atproto-identity-resolver.ts","./src/constants.ts","./src/create-identity-resolver.ts","./src/identity-resolver-error.ts","./src/identity-resolver.ts","./src/index.ts","./src/util.ts"]}
|
package/tsconfig.json
CHANGED