@atcute/identity-resolver 1.1.0 → 1.1.2
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/dist/did/methods/plc.js +1 -1
- package/dist/did/methods/web.js +2 -2
- package/dist/did/methods/xrpc.js +1 -1
- package/dist/handle/methods/doh-json.js +1 -1
- package/dist/handle/methods/well-known.js +1 -1
- package/dist/handle/methods/xrpc.js +1 -1
- package/dist/types.d.ts +1 -1
- package/lib/did/methods/plc.ts +1 -1
- package/lib/did/methods/web.ts +2 -2
- package/lib/did/methods/xrpc.ts +1 -1
- package/lib/handle/methods/doh-json.ts +1 -1
- package/lib/handle/methods/well-known.ts +1 -1
- package/lib/handle/methods/xrpc.ts +1 -1
- package/lib/types.ts +1 -1
- package/package.json +3 -3
package/dist/did/methods/plc.js
CHANGED
|
@@ -18,7 +18,7 @@ export class PlcDidDocumentResolver {
|
|
|
18
18
|
const url = new URL(`/${encodeURIComponent(did)}`, this.apiUrl);
|
|
19
19
|
const response = await (0, this.#fetch)(url, {
|
|
20
20
|
signal: options?.signal,
|
|
21
|
-
cache: options?.noCache ? 'no-cache' :
|
|
21
|
+
cache: options?.noCache ? 'no-cache' : undefined,
|
|
22
22
|
redirect: 'error',
|
|
23
23
|
headers: { accept: 'application/did+ld+json,application/json' },
|
|
24
24
|
});
|
package/dist/did/methods/web.js
CHANGED
|
@@ -17,7 +17,7 @@ export class WebDidDocumentResolver {
|
|
|
17
17
|
const url = webDidToDocumentUrl(did);
|
|
18
18
|
const response = await (0, this.#fetch)(url, {
|
|
19
19
|
signal: options?.signal,
|
|
20
|
-
cache: options?.noCache ? 'no-cache' :
|
|
20
|
+
cache: options?.noCache ? 'no-cache' : undefined,
|
|
21
21
|
redirect: 'error',
|
|
22
22
|
headers: { accept: 'application/did+ld+json,application/json' },
|
|
23
23
|
});
|
|
@@ -52,7 +52,7 @@ export class AtprotoWebDidDocumentResolver {
|
|
|
52
52
|
try {
|
|
53
53
|
const response = await (0, this.#fetch)(url, {
|
|
54
54
|
signal: options?.signal,
|
|
55
|
-
cache: options?.noCache ? 'no-cache' :
|
|
55
|
+
cache: options?.noCache ? 'no-cache' : undefined,
|
|
56
56
|
redirect: 'error',
|
|
57
57
|
headers: { accept: 'application/did+ld+json,application/json' },
|
|
58
58
|
});
|
package/dist/did/methods/xrpc.js
CHANGED
|
@@ -17,7 +17,7 @@ export class XrpcDidDocumentResolver {
|
|
|
17
17
|
url.searchParams.set('did', did);
|
|
18
18
|
const response = await (0, this.#fetch)(url, {
|
|
19
19
|
signal: options?.signal,
|
|
20
|
-
cache: options?.noCache ? 'no-cache' :
|
|
20
|
+
cache: options?.noCache ? 'no-cache' : undefined,
|
|
21
21
|
headers: { accept: 'application/json' },
|
|
22
22
|
});
|
|
23
23
|
const handled = await fetchXrpcHandler(response);
|
|
@@ -61,7 +61,7 @@ export class DohJsonHandleResolver {
|
|
|
61
61
|
url.searchParams.set('type', 'TXT');
|
|
62
62
|
const response = await (0, this.#fetch)(url, {
|
|
63
63
|
signal: options?.signal,
|
|
64
|
-
cache: options?.noCache ? 'no-cache' :
|
|
64
|
+
cache: options?.noCache ? 'no-cache' : undefined,
|
|
65
65
|
headers: { accept: 'application/dns-json' },
|
|
66
66
|
});
|
|
67
67
|
const handled = await fetchDohJsonHandler(response);
|
|
@@ -13,7 +13,7 @@ export class WellKnownHandleResolver {
|
|
|
13
13
|
const url = new URL('/.well-known/atproto-did', `https://${handle}`);
|
|
14
14
|
const response = await (0, this.#fetch)(url, {
|
|
15
15
|
signal: options?.signal,
|
|
16
|
-
cache: options?.noCache ? 'no-cache' :
|
|
16
|
+
cache: options?.noCache ? 'no-cache' : undefined,
|
|
17
17
|
redirect: 'error',
|
|
18
18
|
});
|
|
19
19
|
const handled = await fetchWellKnownHandler(response);
|
|
@@ -20,7 +20,7 @@ export class XrpcHandleResolver {
|
|
|
20
20
|
url.searchParams.set('handle', handle);
|
|
21
21
|
const response = await (0, this.#fetch)(url, {
|
|
22
22
|
signal: options?.signal,
|
|
23
|
-
cache: options?.noCache ? 'no-cache' :
|
|
23
|
+
cache: options?.noCache ? 'no-cache' : undefined,
|
|
24
24
|
headers: { accept: 'application/json' },
|
|
25
25
|
});
|
|
26
26
|
const handled = await fetchXrpcHandler(response);
|
package/dist/types.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export interface ResolveDidDocumentOptions {
|
|
|
4
4
|
signal?: AbortSignal;
|
|
5
5
|
noCache?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export interface DidDocumentResolver<TMethod extends string> {
|
|
7
|
+
export interface DidDocumentResolver<TMethod extends string = string> {
|
|
8
8
|
resolve(did: Did<TMethod>, options?: ResolveDidDocumentOptions): Promise<DidDocument>;
|
|
9
9
|
}
|
|
10
10
|
export interface ResolveHandleOptions {
|
package/lib/did/methods/plc.ts
CHANGED
|
@@ -36,7 +36,7 @@ export class PlcDidDocumentResolver implements DidDocumentResolver<'plc'> {
|
|
|
36
36
|
|
|
37
37
|
const response = await (0, this.#fetch)(url, {
|
|
38
38
|
signal: options?.signal,
|
|
39
|
-
cache: options?.noCache ? 'no-cache' :
|
|
39
|
+
cache: options?.noCache ? 'no-cache' : undefined,
|
|
40
40
|
redirect: 'error',
|
|
41
41
|
headers: { accept: 'application/did+ld+json,application/json' },
|
|
42
42
|
});
|
package/lib/did/methods/web.ts
CHANGED
|
@@ -30,7 +30,7 @@ export class WebDidDocumentResolver implements DidDocumentResolver<'web'> {
|
|
|
30
30
|
|
|
31
31
|
const response = await (0, this.#fetch)(url, {
|
|
32
32
|
signal: options?.signal,
|
|
33
|
-
cache: options?.noCache ? 'no-cache' :
|
|
33
|
+
cache: options?.noCache ? 'no-cache' : undefined,
|
|
34
34
|
redirect: 'error',
|
|
35
35
|
headers: { accept: 'application/did+ld+json,application/json' },
|
|
36
36
|
});
|
|
@@ -75,7 +75,7 @@ export class AtprotoWebDidDocumentResolver implements DidDocumentResolver<'web'>
|
|
|
75
75
|
try {
|
|
76
76
|
const response = await (0, this.#fetch)(url, {
|
|
77
77
|
signal: options?.signal,
|
|
78
|
-
cache: options?.noCache ? 'no-cache' :
|
|
78
|
+
cache: options?.noCache ? 'no-cache' : undefined,
|
|
79
79
|
redirect: 'error',
|
|
80
80
|
headers: { accept: 'application/did+ld+json,application/json' },
|
|
81
81
|
});
|
package/lib/did/methods/xrpc.ts
CHANGED
|
@@ -42,7 +42,7 @@ export class XrpcDidDocumentResolver implements DidDocumentResolver<string> {
|
|
|
42
42
|
|
|
43
43
|
const response = await (0, this.#fetch)(url, {
|
|
44
44
|
signal: options?.signal,
|
|
45
|
-
cache: options?.noCache ? 'no-cache' :
|
|
45
|
+
cache: options?.noCache ? 'no-cache' : undefined,
|
|
46
46
|
headers: { accept: 'application/json' },
|
|
47
47
|
});
|
|
48
48
|
|
|
@@ -86,7 +86,7 @@ export class DohJsonHandleResolver implements HandleResolver {
|
|
|
86
86
|
|
|
87
87
|
const response = await (0, this.#fetch)(url, {
|
|
88
88
|
signal: options?.signal,
|
|
89
|
-
cache: options?.noCache ? 'no-cache' :
|
|
89
|
+
cache: options?.noCache ? 'no-cache' : undefined,
|
|
90
90
|
headers: { accept: 'application/dns-json' },
|
|
91
91
|
});
|
|
92
92
|
|
|
@@ -26,7 +26,7 @@ export class WellKnownHandleResolver implements HandleResolver {
|
|
|
26
26
|
|
|
27
27
|
const response = await (0, this.#fetch)(url, {
|
|
28
28
|
signal: options?.signal,
|
|
29
|
-
cache: options?.noCache ? 'no-cache' :
|
|
29
|
+
cache: options?.noCache ? 'no-cache' : undefined,
|
|
30
30
|
redirect: 'error',
|
|
31
31
|
});
|
|
32
32
|
|
|
@@ -46,7 +46,7 @@ export class XrpcHandleResolver implements HandleResolver {
|
|
|
46
46
|
|
|
47
47
|
const response = await (0, this.#fetch)(url, {
|
|
48
48
|
signal: options?.signal,
|
|
49
|
-
cache: options?.noCache ? 'no-cache' :
|
|
49
|
+
cache: options?.noCache ? 'no-cache' : undefined,
|
|
50
50
|
headers: { accept: 'application/json' },
|
|
51
51
|
});
|
|
52
52
|
|
package/lib/types.ts
CHANGED
|
@@ -6,7 +6,7 @@ export interface ResolveDidDocumentOptions {
|
|
|
6
6
|
noCache?: boolean;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export interface DidDocumentResolver<TMethod extends string> {
|
|
9
|
+
export interface DidDocumentResolver<TMethod extends string = string> {
|
|
10
10
|
resolve(did: Did<TMethod>, options?: ResolveDidDocumentOptions): Promise<DidDocument>;
|
|
11
11
|
}
|
|
12
12
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@atcute/identity-resolver",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.2",
|
|
5
5
|
"description": "atproto handle and DID document resolution",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"atproto",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@badrap/valita": "^0.4.4",
|
|
30
|
-
"@atcute/
|
|
31
|
-
"@atcute/
|
|
30
|
+
"@atcute/lexicons": "^1.0.4",
|
|
31
|
+
"@atcute/util-fetch": "^1.0.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/bun": "^1.2.13",
|