@aws-sdk/util-dns 3.972.14 → 3.972.16
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-cjs/HostResolver.browser.js +2 -6
- package/dist-cjs/HostResolver.js +2 -5
- package/dist-cjs/NodeDnsLookupHostResolver.js +10 -14
- package/dist-cjs/index.browser.js +2 -4
- package/dist-cjs/index.js +3 -27
- package/dist-cjs/util/HostAddressEntryCollection.js +2 -6
- package/dist-cjs/util/HostEntry.js +10 -14
- package/dist-cjs/util/HostEntryTable.js +4 -8
- package/package.json +6 -6
- package/dist-cjs/archive/NodeDnsResolveHostResolver.js +0 -36
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HostResolver = void 0;
|
|
4
|
-
class HostResolver {
|
|
1
|
+
exports.HostResolver = class HostResolver {
|
|
5
2
|
async resolveAddress(args) {
|
|
6
3
|
return [];
|
|
7
4
|
}
|
|
8
5
|
reportFailureOnAddress(addr) { }
|
|
9
6
|
purgeCache(args) { }
|
|
10
|
-
}
|
|
11
|
-
exports.HostResolver = HostResolver;
|
|
7
|
+
};
|
package/dist-cjs/HostResolver.js
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.HostResolver = void 0;
|
|
4
|
-
const NodeDnsLookupHostResolver_1 = require("./NodeDnsLookupHostResolver");
|
|
5
|
-
exports.HostResolver = NodeDnsLookupHostResolver_1.NodeDnsLookupHostResolver;
|
|
1
|
+
const { NodeDnsLookupHostResolver } = require("./NodeDnsLookupHostResolver");
|
|
2
|
+
exports.HostResolver = NodeDnsLookupHostResolver;
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const types_1 = require("@aws-sdk/types");
|
|
5
|
-
const dns_1 = require("dns");
|
|
6
|
-
const HostEntryTable_1 = require("./util/HostEntryTable");
|
|
1
|
+
const { HostAddressType } = require("@aws-sdk/types");
|
|
2
|
+
const { ALL, promises: dnsPromises, V4MAPPED } = require("dns");
|
|
3
|
+
const { HostEntryTable } = require("./util/HostEntryTable");
|
|
7
4
|
const NODE_DNS_FAMILY_TO_HOST_ADDRESS_TYPE = {
|
|
8
|
-
4:
|
|
9
|
-
6:
|
|
5
|
+
4: HostAddressType.A,
|
|
6
|
+
6: HostAddressType.AAAA,
|
|
10
7
|
};
|
|
11
8
|
const DNS_LOOKUP_OPTIONS = {
|
|
12
9
|
all: true,
|
|
13
|
-
hints:
|
|
10
|
+
hints: V4MAPPED | ALL,
|
|
14
11
|
verbatim: true,
|
|
15
12
|
};
|
|
16
|
-
class NodeDnsLookupHostResolver {
|
|
13
|
+
exports.NodeDnsLookupHostResolver = class NodeDnsLookupHostResolver {
|
|
17
14
|
static DEFAULT_TTL_MS = 30_000;
|
|
18
|
-
static createDefaultCacheProvider = () => new
|
|
19
|
-
static DEFAULT_NODE_DNS_LOOKUP =
|
|
15
|
+
static createDefaultCacheProvider = () => new HostEntryTable();
|
|
16
|
+
static DEFAULT_NODE_DNS_LOOKUP = dnsPromises.lookup;
|
|
20
17
|
ttlMs;
|
|
21
18
|
cache;
|
|
22
19
|
nodeDnsLookup;
|
|
@@ -87,5 +84,4 @@ class NodeDnsLookupHostResolver {
|
|
|
87
84
|
}
|
|
88
85
|
return addresses;
|
|
89
86
|
}
|
|
90
|
-
}
|
|
91
|
-
exports.NodeDnsLookupHostResolver = NodeDnsLookupHostResolver;
|
|
87
|
+
};
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./HostResolver"), exports);
|
|
1
|
+
var __exportStar = (m, e) => { Object.assign(e, m); };
|
|
2
|
+
__exportStar(require("./HostResolver"), exports);
|
package/dist-cjs/index.js
CHANGED
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var NodeDnsLookupHostResolver = require('./NodeDnsLookupHostResolver');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.prototype.hasOwnProperty.call(HostResolver, '__proto__') &&
|
|
9
|
-
!Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
|
|
10
|
-
Object.defineProperty(exports, '__proto__', {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
value: HostResolver['__proto__']
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
Object.keys(HostResolver).forEach(function (k) {
|
|
16
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = HostResolver[k];
|
|
17
|
-
});
|
|
18
|
-
Object.prototype.hasOwnProperty.call(NodeDnsLookupHostResolver, '__proto__') &&
|
|
19
|
-
!Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
|
|
20
|
-
Object.defineProperty(exports, '__proto__', {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
value: NodeDnsLookupHostResolver['__proto__']
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
Object.keys(NodeDnsLookupHostResolver).forEach(function (k) {
|
|
26
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = NodeDnsLookupHostResolver[k];
|
|
27
|
-
});
|
|
1
|
+
var __exportStar = (m, e) => { Object.assign(e, m); };
|
|
2
|
+
__exportStar(require("./HostResolver"), exports);
|
|
3
|
+
__exportStar(require("./NodeDnsLookupHostResolver"), exports);
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HostAddressEntryCollection = void 0;
|
|
4
|
-
class HostAddressEntryCollection {
|
|
1
|
+
exports.HostAddressEntryCollection = class HostAddressEntryCollection {
|
|
5
2
|
data = [];
|
|
6
3
|
get length() {
|
|
7
4
|
return this.data.length;
|
|
@@ -29,5 +26,4 @@ class HostAddressEntryCollection {
|
|
|
29
26
|
[Symbol.iterator]() {
|
|
30
27
|
return this.data[Symbol.iterator]();
|
|
31
28
|
}
|
|
32
|
-
}
|
|
33
|
-
exports.HostAddressEntryCollection = HostAddressEntryCollection;
|
|
29
|
+
};
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.HostEntry =
|
|
4
|
-
const types_1 = require("@aws-sdk/types");
|
|
5
|
-
const HostAddressEntryCollection_1 = require("./HostAddressEntryCollection");
|
|
6
|
-
class HostEntry {
|
|
1
|
+
const { HostAddressType } = require("@aws-sdk/types");
|
|
2
|
+
const { HostAddressEntryCollection } = require("./HostAddressEntryCollection");
|
|
3
|
+
exports.HostEntry = class HostEntry {
|
|
7
4
|
aaaaRecords;
|
|
8
5
|
aRecords;
|
|
9
6
|
failedAaaaRecords;
|
|
10
7
|
failedARecords;
|
|
11
8
|
nextTimestampToUpdateMs;
|
|
12
9
|
constructor(nextTimestampToProcessMs) {
|
|
13
|
-
this.aaaaRecords = new
|
|
14
|
-
this.aRecords = new
|
|
15
|
-
this.failedAaaaRecords = new
|
|
16
|
-
this.failedARecords = new
|
|
10
|
+
this.aaaaRecords = new HostAddressEntryCollection();
|
|
11
|
+
this.aRecords = new HostAddressEntryCollection();
|
|
12
|
+
this.failedAaaaRecords = new HostAddressEntryCollection();
|
|
13
|
+
this.failedARecords = new HostAddressEntryCollection();
|
|
17
14
|
this.nextTimestampToUpdateMs = nextTimestampToProcessMs;
|
|
18
15
|
}
|
|
19
16
|
updateRecords(addresses, expirationTtlMs) {
|
|
@@ -116,10 +113,9 @@ class HostEntry {
|
|
|
116
113
|
}
|
|
117
114
|
}
|
|
118
115
|
getGoodRecords(address) {
|
|
119
|
-
return address.addressType ===
|
|
116
|
+
return address.addressType === HostAddressType.AAAA ? this.aaaaRecords : this.aRecords;
|
|
120
117
|
}
|
|
121
118
|
getFailedRecords(address) {
|
|
122
|
-
return address.addressType ===
|
|
119
|
+
return address.addressType === HostAddressType.AAAA ? this.failedAaaaRecords : this.failedARecords;
|
|
123
120
|
}
|
|
124
|
-
}
|
|
125
|
-
exports.HostEntry = HostEntry;
|
|
121
|
+
};
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.HostEntryTable = void 0;
|
|
4
|
-
const HostEntry_1 = require("./HostEntry");
|
|
5
|
-
class HostEntryTable {
|
|
1
|
+
const { HostEntry } = require("./HostEntry");
|
|
2
|
+
exports.HostEntryTable = class HostEntryTable {
|
|
6
3
|
map;
|
|
7
4
|
constructor() {
|
|
8
5
|
this.map = new Map();
|
|
9
6
|
}
|
|
10
7
|
set(args, addresses, nextTimestampToProcessMs) {
|
|
11
|
-
const hostEntry = new
|
|
8
|
+
const hostEntry = new HostEntry(nextTimestampToProcessMs);
|
|
12
9
|
hostEntry.updateRecords(addresses, nextTimestampToProcessMs);
|
|
13
10
|
this.map.set(args.hostName, hostEntry);
|
|
14
11
|
}
|
|
@@ -24,5 +21,4 @@ class HostEntryTable {
|
|
|
24
21
|
get size() {
|
|
25
22
|
return this.map.size;
|
|
26
23
|
}
|
|
27
|
-
}
|
|
28
|
-
exports.HostEntryTable = HostEntryTable;
|
|
24
|
+
};
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/util-dns",
|
|
3
|
-
"version": "3.972.
|
|
3
|
+
"version": "3.972.16",
|
|
4
4
|
"description": "Implementations of DNS host resolvers.",
|
|
5
5
|
"main": "./dist-cjs/index.js",
|
|
6
6
|
"module": "./dist-es/index.js",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
|
|
9
|
-
"build:cjs": "node ../../scripts/compilation/inline
|
|
10
|
-
"build:es": "tsc -p tsconfig.es.json",
|
|
9
|
+
"build:cjs": "node ../../scripts/compilation/inline",
|
|
10
|
+
"build:es": "premove dist-es && tsc -p tsconfig.es.json",
|
|
11
11
|
"build:include:deps": "yarn g:turbo run build -F=\"$npm_package_name\"",
|
|
12
|
-
"build:types": "tsc -p tsconfig.types.json",
|
|
12
|
+
"build:types": "premove dist-types && tsc -p tsconfig.types.json",
|
|
13
13
|
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
|
|
14
|
-
"clean": "premove dist-cjs dist-es dist-types
|
|
14
|
+
"clean": "premove dist-cjs dist-es dist-types",
|
|
15
15
|
"test": "yarn g:vitest run && yarn test:browser",
|
|
16
16
|
"test:watch": "yarn g:vitest watch",
|
|
17
17
|
"test:browser": "yarn g:vitest run -c vitest.config.browser.mts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"license": "Apache-2.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@aws-sdk/types": "^3.973.
|
|
30
|
+
"@aws-sdk/types": "^3.973.13",
|
|
31
31
|
"tslib": "^2.6.2"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NodeDnsResolveHostResolver = void 0;
|
|
4
|
-
const types_1 = require("@aws-sdk/types");
|
|
5
|
-
const dns_1 = require("dns");
|
|
6
|
-
class NodeDnsResolveHostResolver {
|
|
7
|
-
async resolveAddress(args) {
|
|
8
|
-
const addresses = [];
|
|
9
|
-
const ipV4Addresses = await dns_1.promises.resolve4(args.hostName);
|
|
10
|
-
for (const address of ipV4Addresses) {
|
|
11
|
-
addresses.push({
|
|
12
|
-
addressType: types_1.HostAddressType.A,
|
|
13
|
-
address,
|
|
14
|
-
hostName: args.hostName,
|
|
15
|
-
service: args.service,
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
const ipV6Addresses = await dns_1.promises.resolve6(args.hostName);
|
|
19
|
-
for (const address of ipV6Addresses) {
|
|
20
|
-
addresses.push({
|
|
21
|
-
addressType: types_1.HostAddressType.AAAA,
|
|
22
|
-
address,
|
|
23
|
-
hostName: args.hostName,
|
|
24
|
-
service: args.service,
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
return addresses;
|
|
28
|
-
}
|
|
29
|
-
reportFailureOnAddress(addr) {
|
|
30
|
-
throw new Error("reportFailureOnAddress(addr) is not implemented");
|
|
31
|
-
}
|
|
32
|
-
purgeCache(args) {
|
|
33
|
-
throw new Error("purgeCache(args?) is not implemented");
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
exports.NodeDnsResolveHostResolver = NodeDnsResolveHostResolver;
|