@tradetrust-tt/dnsprove 2.13.1 → 2.13.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/ts/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export interface IDNSQueryResponse {
|
|
|
13
13
|
interface GenericObject {
|
|
14
14
|
[key: string]: string;
|
|
15
15
|
}
|
|
16
|
-
export
|
|
16
|
+
export type CustomDnsResolver = (domain: string) => Promise<IDNSQueryResponse>;
|
|
17
17
|
export declare const defaultDnsResolvers: CustomDnsResolver[];
|
|
18
18
|
export declare const queryDns: (domain: string, customDnsResolvers: CustomDnsResolver[]) => Promise<IDNSQueryResponse>;
|
|
19
19
|
/**
|
|
@@ -38,6 +38,6 @@ export declare const parseDnsDidResults: (recordSet: IDNSRecord[] | undefined, d
|
|
|
38
38
|
addr: '0x2f60375e8144e16Adf1979936301D8341D58C36C',
|
|
39
39
|
dnssec: true } ]
|
|
40
40
|
*/
|
|
41
|
-
export declare const getDocumentStoreRecords: (domain: string, customDnsResolvers?: CustomDnsResolver[]
|
|
42
|
-
export declare const getDnsDidRecords: (domain: string, customDnsResolvers?: CustomDnsResolver[]
|
|
41
|
+
export declare const getDocumentStoreRecords: (domain: string, customDnsResolvers?: CustomDnsResolver[]) => Promise<OpenAttestationDNSTextRecord[]>;
|
|
42
|
+
export declare const getDnsDidRecords: (domain: string, customDnsResolvers?: CustomDnsResolver[]) => Promise<OpenAttestationDnsDidRecord[]>;
|
|
43
43
|
export { OpenAttestationDNSTextRecord, OpenAttestationDnsDidRecord };
|
|
@@ -12,4 +12,4 @@ export declare const OpenAttestationDnsDidRecordT: import("runtypes").Intersect<
|
|
|
12
12
|
}, false>, Partial<{
|
|
13
13
|
dnssec: Boolean;
|
|
14
14
|
}, false>]>;
|
|
15
|
-
export
|
|
15
|
+
export type OpenAttestationDnsDidRecord = Static<typeof OpenAttestationDnsDidRecordT>;
|
|
@@ -40,7 +40,7 @@ export declare const OpenAttestationDNSTextRecordT: Union<[import("runtypes").In
|
|
|
40
40
|
}, false>, Partial<{
|
|
41
41
|
dnssec: Boolean;
|
|
42
42
|
}, false>]>]>;
|
|
43
|
-
export
|
|
44
|
-
export
|
|
45
|
-
export
|
|
46
|
-
export
|
|
43
|
+
export type BlockchainNetwork = Static<typeof BlockchainNetworkT>;
|
|
44
|
+
export type EthereumAddress = Static<typeof EthereumAddressT>;
|
|
45
|
+
export type OpenAttestationDNSTextRecord = Static<typeof OpenAttestationDNSTextRecordT>;
|
|
46
|
+
export type RecordTypes = Static<typeof RecordTypesT>;
|
package/dist/ts/util/logger.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tradetrust-tt/dnsprove",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.2",
|
|
4
4
|
"description": "Helper utility for retrieving OpenAttestations document store address records from DNS",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"generator-nod"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"axios": "
|
|
48
|
+
"axios": "1.7.2",
|
|
49
49
|
"debug": "^4.3.1",
|
|
50
50
|
"runtypes": "^6.3.0"
|
|
51
51
|
},
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@babel/cli": "^7.13.16",
|
|
54
54
|
"@babel/core": "^7.13.16",
|
|
55
55
|
"@babel/plugin-proposal-class-properties": "^7.13.0",
|
|
56
|
-
"@babel/preset-env": "^7.
|
|
56
|
+
"@babel/preset-env": "^7.24.8",
|
|
57
57
|
"@babel/preset-typescript": "^7.13.0",
|
|
58
58
|
"@commitlint/cli": "^18.4.3",
|
|
59
59
|
"@commitlint/config-conventional": "18.4.3",
|
|
@@ -63,25 +63,25 @@
|
|
|
63
63
|
"@typescript-eslint/eslint-plugin": "^4.22.0",
|
|
64
64
|
"@typescript-eslint/parser": "^4.22.0",
|
|
65
65
|
"babel-eslint": "^10.1.0",
|
|
66
|
-
"babel-jest": "^
|
|
66
|
+
"babel-jest": "^29.7.0",
|
|
67
67
|
"commitizen": "^4.3.0",
|
|
68
68
|
"documentation": "^14.0.2",
|
|
69
69
|
"eslint": "^7.25.0",
|
|
70
70
|
"eslint-config-airbnb-base": "^14.2.1",
|
|
71
71
|
"eslint-config-prettier": "^8.3.0",
|
|
72
|
-
"eslint-plugin-import": "^2.
|
|
72
|
+
"eslint-plugin-import": "^2.29.1",
|
|
73
73
|
"eslint-plugin-prettier": "^3.4.0",
|
|
74
74
|
"git-cz": "^4.9.0",
|
|
75
75
|
"husky": "^8.0.3",
|
|
76
|
-
"jest": "^
|
|
76
|
+
"jest": "^29.7.0",
|
|
77
77
|
"lint-staged": "^10.5.4",
|
|
78
|
-
"msw": "
|
|
78
|
+
"msw": "^2.3.1",
|
|
79
79
|
"open-cli": "^7.2.0",
|
|
80
80
|
"prettier": "^2.2.1",
|
|
81
81
|
"rimraf": "^3.0.2",
|
|
82
82
|
"semantic-release": "^22.0.8",
|
|
83
|
-
"ts-jest": "^
|
|
84
|
-
"typescript": "
|
|
83
|
+
"ts-jest": "^29.2.2",
|
|
84
|
+
"typescript": "5.5.3"
|
|
85
85
|
},
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
package/src/index.test.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
import { setupServer, SetupServerApi } from "msw/node";
|
|
3
|
-
import {
|
|
3
|
+
import { http, HttpResponse } from "msw";
|
|
4
4
|
import { CustomDnsResolver, getDocumentStoreRecords, queryDns, parseDocumentStoreResults, getDnsDidRecords } from ".";
|
|
5
5
|
import { DnsproveStatusCode } from "./common/error";
|
|
6
6
|
|
|
@@ -234,8 +234,8 @@ describe("queryDns", () => {
|
|
|
234
234
|
|
|
235
235
|
test("Should work for first dns if first dns is not down", async () => {
|
|
236
236
|
const handlers = [
|
|
237
|
-
|
|
238
|
-
return
|
|
237
|
+
http.get("https://dns.google/resolve", (_) => {
|
|
238
|
+
return HttpResponse.json(sampleResponse);
|
|
239
239
|
}),
|
|
240
240
|
];
|
|
241
241
|
|
|
@@ -249,11 +249,11 @@ describe("queryDns", () => {
|
|
|
249
249
|
|
|
250
250
|
test("Should fallback to second dns when first dns is down", async () => {
|
|
251
251
|
const handlers = [
|
|
252
|
-
|
|
253
|
-
return
|
|
252
|
+
http.get("https://dns.google/resolve", (_) => {
|
|
253
|
+
return new HttpResponse(null, { status: 500 });
|
|
254
254
|
}),
|
|
255
|
-
|
|
256
|
-
return
|
|
255
|
+
http.get("https://cloudflare-dns.com/dns-query", (_) => {
|
|
256
|
+
return HttpResponse.json(sampleResponse);
|
|
257
257
|
}),
|
|
258
258
|
];
|
|
259
259
|
server = setupServer(...handlers);
|
|
@@ -267,11 +267,11 @@ describe("queryDns", () => {
|
|
|
267
267
|
|
|
268
268
|
test("Should throw error when all dns provided are down", async () => {
|
|
269
269
|
const handlers = [
|
|
270
|
-
|
|
271
|
-
return
|
|
270
|
+
http.get("https://dns.google/resolve", (_) => {
|
|
271
|
+
return new HttpResponse(null, { status: 500 });
|
|
272
272
|
}),
|
|
273
|
-
|
|
274
|
-
return
|
|
273
|
+
http.get("https://cloudflare-dns.com/dns-query", (_) => {
|
|
274
|
+
return new HttpResponse(null, { status: 500 });
|
|
275
275
|
}),
|
|
276
276
|
];
|
|
277
277
|
server = setupServer(...handlers);
|