@aws-sdk/types 3.266.1 → 3.271.0
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/dns.js +8 -0
- package/dist-cjs/index.js +1 -0
- package/dist-es/dns.js +5 -0
- package/dist-es/index.js +1 -0
- package/dist-types/dns.d.ts +75 -0
- package/dist-types/index.d.ts +1 -0
- package/dist-types/ts3.4/dns.d.ts +19 -0
- package/dist-types/ts3.4/index.d.ts +1 -0
- package/package.json +1 -1
package/dist-cjs/dns.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HostAddressType = void 0;
|
|
4
|
+
var HostAddressType;
|
|
5
|
+
(function (HostAddressType) {
|
|
6
|
+
HostAddressType["AAAA"] = "AAAA";
|
|
7
|
+
HostAddressType["A"] = "A";
|
|
8
|
+
})(HostAddressType = exports.HostAddressType || (exports.HostAddressType = {}));
|
package/dist-cjs/index.js
CHANGED
|
@@ -8,6 +8,7 @@ tslib_1.__exportStar(require("./client"), exports);
|
|
|
8
8
|
tslib_1.__exportStar(require("./command"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./credentials"), exports);
|
|
10
10
|
tslib_1.__exportStar(require("./crypto"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./dns"), exports);
|
|
11
12
|
tslib_1.__exportStar(require("./endpoint"), exports);
|
|
12
13
|
tslib_1.__exportStar(require("./eventStream"), exports);
|
|
13
14
|
tslib_1.__exportStar(require("./http"), exports);
|
package/dist-es/dns.js
ADDED
package/dist-es/index.js
CHANGED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DNS record types
|
|
3
|
+
*/
|
|
4
|
+
export declare enum HostAddressType {
|
|
5
|
+
/**
|
|
6
|
+
* IPv6
|
|
7
|
+
*/
|
|
8
|
+
AAAA = "AAAA",
|
|
9
|
+
/**
|
|
10
|
+
* IPv4
|
|
11
|
+
*/
|
|
12
|
+
A = "A"
|
|
13
|
+
}
|
|
14
|
+
export interface HostAddress {
|
|
15
|
+
/**
|
|
16
|
+
* The {@link HostAddressType} of the host address.
|
|
17
|
+
*/
|
|
18
|
+
addressType: HostAddressType;
|
|
19
|
+
/**
|
|
20
|
+
* The resolved numerical address represented as a
|
|
21
|
+
* string.
|
|
22
|
+
*/
|
|
23
|
+
address: string;
|
|
24
|
+
/**
|
|
25
|
+
* The host name the {@link address} was resolved from.
|
|
26
|
+
*/
|
|
27
|
+
hostName: string;
|
|
28
|
+
/**
|
|
29
|
+
* The service record of {@link hostName}.
|
|
30
|
+
*/
|
|
31
|
+
service?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface HostResolverArguments {
|
|
34
|
+
/**
|
|
35
|
+
* The host name to resolve.
|
|
36
|
+
*/
|
|
37
|
+
hostName: string;
|
|
38
|
+
/**
|
|
39
|
+
* The service record of {@link hostName}.
|
|
40
|
+
*/
|
|
41
|
+
service?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Host Resolver interface for DNS queries
|
|
45
|
+
*/
|
|
46
|
+
export interface HostResolver {
|
|
47
|
+
/**
|
|
48
|
+
* Resolves the address(es) for {@link HostResolverArguments} and returns a
|
|
49
|
+
* list of addresses with (most likely) two addresses, one {@link HostAddressType.AAAA}
|
|
50
|
+
* and one {@link HostAddressType.A}. Calls to this function will likely alter
|
|
51
|
+
* the cache (if implemented) so that if there's multiple addresses, a different
|
|
52
|
+
* set will be returned on the next call.
|
|
53
|
+
* In the case of multi-answer, still only a maximum of two records should be
|
|
54
|
+
* returned. The resolver implementation is responsible for caching and rotation
|
|
55
|
+
* of the multiple addresses that get returned.
|
|
56
|
+
* Implementations don't have to explictly call getaddrinfo(), they can use
|
|
57
|
+
* high level abstractions provided in their language runtimes/libraries.
|
|
58
|
+
* @param args arguments with host name query addresses for
|
|
59
|
+
* @returns promise with a list of {@link HostAddress}
|
|
60
|
+
*/
|
|
61
|
+
resolveAddress(args: HostResolverArguments): Promise<HostAddress[]>;
|
|
62
|
+
/**
|
|
63
|
+
* Reports a failure on a {@link HostAddress} so that the cache (if implemented)
|
|
64
|
+
* can accomodate the failure and likely not return the address until it recovers.
|
|
65
|
+
* @param addr host address to report a failure on
|
|
66
|
+
*/
|
|
67
|
+
reportFailureOnAddress(addr: HostAddress): void;
|
|
68
|
+
/**
|
|
69
|
+
* Empties the cache (if implemented) for a {@link HostResolverArguments.hostName}.
|
|
70
|
+
* If {@link HostResolverArguments.hostName} is not provided, the cache (if
|
|
71
|
+
* implemented) is emptied for all host names.
|
|
72
|
+
* @param args optional arguments to empty the cache for
|
|
73
|
+
*/
|
|
74
|
+
purgeCache(args?: HostResolverArguments): void;
|
|
75
|
+
}
|
package/dist-types/index.d.ts
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare enum HostAddressType {
|
|
2
|
+
AAAA = "AAAA",
|
|
3
|
+
A = "A",
|
|
4
|
+
}
|
|
5
|
+
export interface HostAddress {
|
|
6
|
+
addressType: HostAddressType;
|
|
7
|
+
address: string;
|
|
8
|
+
hostName: string;
|
|
9
|
+
service?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface HostResolverArguments {
|
|
12
|
+
hostName: string;
|
|
13
|
+
service?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface HostResolver {
|
|
16
|
+
resolveAddress(args: HostResolverArguments): Promise<HostAddress[]>;
|
|
17
|
+
reportFailureOnAddress(addr: HostAddress): void;
|
|
18
|
+
purgeCache(args?: HostResolverArguments): void;
|
|
19
|
+
}
|