@atcute/identity-resolver-node 1.0.2 → 1.0.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/LICENSE +12 -15
- package/README.md +23 -23
- package/dist/did/methods/node.d.ts +1 -0
- package/dist/did/methods/node.d.ts.map +1 -0
- package/dist/did/methods/node.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -0
- package/lib/index.ts +1 -1
- package/package.json +19 -15
package/LICENSE
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
3
|
-
in the Software without restriction, including without limitation the rights
|
|
4
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
5
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
6
|
-
furnished to do so, subject to the following conditions:
|
|
1
|
+
BSD Zero Clause License
|
|
7
2
|
|
|
8
|
-
|
|
9
|
-
copies or substantial portions of the Software.
|
|
3
|
+
Copyright (c) 2025 Mary
|
|
10
4
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
# @atcute/identity-resolver-node
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Node.js handle resolver using native DNS.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm install @atcute/identity-resolver-node
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
provides `NodeDnsHandleResolver` which resolves handles via DNS TXT records using Node.js's native
|
|
10
|
+
`dns` module, avoiding the need for HTTP-based resolution.
|
|
11
|
+
|
|
12
|
+
## usage
|
|
4
13
|
|
|
5
14
|
```ts
|
|
6
|
-
|
|
15
|
+
import { CompositeHandleResolver, WellKnownHandleResolver } from '@atcute/identity-resolver';
|
|
16
|
+
import { NodeDnsHandleResolver } from '@atcute/identity-resolver-node';
|
|
17
|
+
|
|
7
18
|
const handleResolver = new CompositeHandleResolver({
|
|
8
19
|
strategy: 'race',
|
|
9
20
|
methods: {
|
|
@@ -12,25 +23,14 @@ const handleResolver = new CompositeHandleResolver({
|
|
|
12
23
|
},
|
|
13
24
|
});
|
|
14
25
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (err instanceof AmbiguousHandleError) {
|
|
26
|
-
// handle returned multiple did values
|
|
27
|
-
}
|
|
28
|
-
if (err instanceof FailedHandleResolutionError) {
|
|
29
|
-
// handle resolution had thrown something unexpected (fetch error)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (err instanceof HandleResolutionError) {
|
|
33
|
-
// the errors above extend this class, so you can do a catch-all.
|
|
34
|
-
}
|
|
35
|
-
}
|
|
26
|
+
const did = await handleResolver.resolve('bsky.app');
|
|
27
|
+
// -> 'did:plc:z72i7hdynmk6r22z27h6tvur'
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### custom nameservers
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
const resolver = new NodeDnsHandleResolver({
|
|
34
|
+
nameservers: ['8.8.8.8', '8.8.4.4'],
|
|
35
|
+
});
|
|
36
36
|
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../lib/did/methods/node.ts"],"names":[],"mappings":"AAGA,OAAO,EAKN,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAKlE,MAAM,WAAW,4BAA4B;IAC5C,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,qBAAa,qBAAsB,YAAW,cAAc;;IAG3D,IAAI,WAAW,IAAI,MAAM,EAAE,GAAG,SAAS,CAEtC;IAED,YAAY,EAAE,WAAW,EAAE,GAAE,4BAAiC,EAK7D;IAEK,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC,CA0CjF;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../../lib/did/methods/node.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,mBAAmB,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EACN,oBAAoB,EACpB,gBAAgB,EAChB,2BAA2B,EAC3B,0BAA0B,GAG1B,MAAM,2BAA2B,CAAC;AAGnC,MAAM,SAAS,GAAG,UAAU,CAAC;AAC7B,MAAM,MAAM,GAAG,MAAM,CAAC;AAMtB,MAAM,OAAO,qBAAqB;IACjC,SAAS,GAAwB,IAAI,CAAC;IAEtC,IAAI,WAAW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E,MAAM,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;CACD"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from './did/methods/node.
|
|
1
|
+
export * from './did/methods/node.ts';
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
package/lib/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './did/methods/node.
|
|
1
|
+
export * from './did/methods/node.ts';
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"type": "module",
|
|
3
2
|
"name": "@atcute/identity-resolver-node",
|
|
4
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
5
4
|
"description": "additional atproto identity resolvers for Node.js",
|
|
6
5
|
"keywords": [
|
|
7
6
|
"atproto",
|
|
8
7
|
"did"
|
|
9
8
|
],
|
|
10
|
-
"license": "
|
|
9
|
+
"license": "0BSD",
|
|
11
10
|
"repository": {
|
|
12
11
|
"url": "https://github.com/mary-ext/atcute",
|
|
13
12
|
"directory": "packages/identity/identity-resolver-node"
|
|
@@ -16,27 +15,32 @@
|
|
|
16
15
|
"dist/",
|
|
17
16
|
"lib/",
|
|
18
17
|
"!lib/**/*.bench.ts",
|
|
19
|
-
"!lib/**/*.test.ts"
|
|
18
|
+
"!lib/**/*.test.ts",
|
|
19
|
+
"!dist/**/*.{test,bench}.*"
|
|
20
20
|
],
|
|
21
|
+
"type": "module",
|
|
22
|
+
"sideEffects": false,
|
|
21
23
|
"exports": {
|
|
22
24
|
".": "./dist/index.js"
|
|
23
25
|
},
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@atcute/lexicons": "^1.3.1"
|
|
28
31
|
},
|
|
29
32
|
"devDependencies": {
|
|
30
|
-
"@types/
|
|
31
|
-
"@atcute/identity": "^1.
|
|
32
|
-
"@atcute/identity-resolver": "^1.
|
|
33
|
+
"@types/node": "^25.6.0",
|
|
34
|
+
"@atcute/identity": "^1.1.5",
|
|
35
|
+
"@atcute/identity-resolver": "^1.2.3"
|
|
33
36
|
},
|
|
34
|
-
"
|
|
35
|
-
"@atcute/
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"@atcute/identity": "^1.0.0",
|
|
39
|
+
"@atcute/identity-resolver": "^1.0.0",
|
|
40
|
+
"@atcute/lexicons": "^1.0.0"
|
|
36
41
|
},
|
|
37
42
|
"scripts": {
|
|
38
|
-
"build": "
|
|
39
|
-
"test": "bun test --coverage",
|
|
43
|
+
"build": "tsgo",
|
|
40
44
|
"prepublish": "rm -rf dist; pnpm run build"
|
|
41
45
|
}
|
|
42
46
|
}
|