-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add missing promises in node:dns (#3292)
- Loading branch information
Showing
5 changed files
with
175 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,164 +1,4 @@ | ||
import * as errorCodes from 'node-internal:internal_dns_constants'; | ||
import { | ||
reverse, | ||
resolveTxt, | ||
resolveCaa, | ||
resolveMx, | ||
resolveCname, | ||
resolveNs, | ||
resolvePtr, | ||
resolveSrv, | ||
resolveSoa, | ||
resolveNaptr, | ||
resolve4, | ||
resolve6, | ||
getServers, | ||
setServers, | ||
getDefaultResultOrder, | ||
setDefaultResultOrder, | ||
lookup, | ||
lookupService, | ||
resolve, | ||
resolveAny, | ||
} from 'node-internal:internal_dns'; | ||
import { | ||
CAA, | ||
MX, | ||
NAPTR, | ||
SOA, | ||
SRV, | ||
TTLResponse, | ||
} from 'node:internal/internal_dns_client'; | ||
import * as dns from 'node-internal:internal_dns_promises'; | ||
|
||
export * from 'node-internal:internal_dns_constants'; | ||
export { | ||
reverse, | ||
resolveTxt, | ||
resolveCaa, | ||
resolveMx, | ||
resolveCname, | ||
resolveNs, | ||
resolvePtr, | ||
resolveSrv, | ||
resolveSoa, | ||
resolveNaptr, | ||
resolve4, | ||
resolve6, | ||
getServers, | ||
setServers, | ||
getDefaultResultOrder, | ||
setDefaultResultOrder, | ||
lookup, | ||
lookupService, | ||
resolve, | ||
resolveAny, | ||
} from 'node-internal:internal_dns'; | ||
|
||
export class Resolver { | ||
// eslint-disable-next-line @typescript-eslint/require-await | ||
public async cancel(): Promise<void> { | ||
// TODO(soon): Implement this. | ||
throw new Error('Not implemented'); | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/require-await | ||
public async setLocalAddress(): Promise<void> { | ||
// Does not apply to workerd implementation | ||
throw new Error('Not implemented'); | ||
} | ||
|
||
public getServers(): Promise<string[]> { | ||
return getServers(); | ||
} | ||
|
||
public resolve(): Promise<void> { | ||
return resolve(); | ||
} | ||
|
||
public resolve4( | ||
input: string, | ||
options?: { ttl?: boolean } | ||
): Promise<(string | TTLResponse)[]> { | ||
return resolve4(input, options); | ||
} | ||
|
||
public resolve6( | ||
input: string, | ||
options?: { ttl?: boolean } | ||
): Promise<(string | TTLResponse)[]> { | ||
return resolve6(input, options); | ||
} | ||
|
||
public resolveAny(): Promise<void> { | ||
return resolveAny(); | ||
} | ||
|
||
public resolveCaa(name: string): Promise<CAA[]> { | ||
return resolveCaa(name); | ||
} | ||
|
||
public resolveCname(name: string): Promise<string[]> { | ||
return resolveCname(name); | ||
} | ||
|
||
public resolveMx(name: string): Promise<MX[]> { | ||
return resolveMx(name); | ||
} | ||
|
||
public resolveNaptr(name: string): Promise<NAPTR[]> { | ||
return resolveNaptr(name); | ||
} | ||
|
||
public resolveNs(name: string): Promise<string[]> { | ||
return resolveNs(name); | ||
} | ||
|
||
public esolvePtr(name: string): Promise<string[]> { | ||
return resolvePtr(name); | ||
} | ||
|
||
public resolveSoa(name: string): Promise<SOA> { | ||
return resolveSoa(name); | ||
} | ||
|
||
public resolveSrv(name: string): Promise<SRV[]> { | ||
return resolveSrv(name); | ||
} | ||
|
||
public resolveTxt(name: string): Promise<string[][]> { | ||
return resolveTxt(name); | ||
} | ||
|
||
public reverse(name: string): Promise<string[]> { | ||
return reverse(name); | ||
} | ||
|
||
public setServers(): Promise<void> { | ||
return setServers(); | ||
} | ||
} | ||
|
||
export default { | ||
reverse, | ||
resolveTxt, | ||
resolveCaa, | ||
resolveMx, | ||
resolveCname, | ||
resolveNs, | ||
resolvePtr, | ||
resolveSrv, | ||
resolveSoa, | ||
resolveNaptr, | ||
resolve4, | ||
resolve6, | ||
getServers, | ||
setServers, | ||
getDefaultResultOrder, | ||
setDefaultResultOrder, | ||
lookup, | ||
lookupService, | ||
resolve, | ||
resolveAny, | ||
Resolver, | ||
...errorCodes, | ||
}; | ||
export * from 'node-internal:internal_dns_promises'; | ||
export default dns; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
import * as errorCodes from 'node-internal:internal_dns_constants'; | ||
import { | ||
reverse, | ||
resolveTxt, | ||
resolveCaa, | ||
resolveMx, | ||
resolveCname, | ||
resolveNs, | ||
resolvePtr, | ||
resolveSrv, | ||
resolveSoa, | ||
resolveNaptr, | ||
resolve4, | ||
resolve6, | ||
getServers, | ||
setServers, | ||
getDefaultResultOrder, | ||
setDefaultResultOrder, | ||
lookup, | ||
lookupService, | ||
resolve, | ||
resolveAny, | ||
} from 'node-internal:internal_dns'; | ||
import { | ||
CAA, | ||
MX, | ||
NAPTR, | ||
SOA, | ||
SRV, | ||
TTLResponse, | ||
} from 'node:internal/internal_dns_client'; | ||
|
||
export * from 'node-internal:internal_dns_constants'; | ||
export { | ||
reverse, | ||
resolveTxt, | ||
resolveCaa, | ||
resolveMx, | ||
resolveCname, | ||
resolveNs, | ||
resolvePtr, | ||
resolveSrv, | ||
resolveSoa, | ||
resolveNaptr, | ||
resolve4, | ||
resolve6, | ||
getServers, | ||
setServers, | ||
getDefaultResultOrder, | ||
setDefaultResultOrder, | ||
lookup, | ||
lookupService, | ||
resolve, | ||
resolveAny, | ||
} from 'node-internal:internal_dns'; | ||
|
||
export class Resolver { | ||
// eslint-disable-next-line @typescript-eslint/require-await | ||
public async cancel(): Promise<void> { | ||
// TODO(soon): Implement this. | ||
throw new Error('Not implemented'); | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/require-await | ||
public async setLocalAddress(): Promise<void> { | ||
// Does not apply to workerd implementation | ||
throw new Error('Not implemented'); | ||
} | ||
|
||
public getServers(): Promise<string[]> { | ||
return getServers(); | ||
} | ||
|
||
public resolve(): Promise<void> { | ||
return resolve(); | ||
} | ||
|
||
public resolve4( | ||
input: string, | ||
options?: { ttl?: boolean } | ||
): Promise<(string | TTLResponse)[]> { | ||
return resolve4(input, options); | ||
} | ||
|
||
public resolve6( | ||
input: string, | ||
options?: { ttl?: boolean } | ||
): Promise<(string | TTLResponse)[]> { | ||
return resolve6(input, options); | ||
} | ||
|
||
public resolveAny(): Promise<void> { | ||
return resolveAny(); | ||
} | ||
|
||
public resolveCaa(name: string): Promise<CAA[]> { | ||
return resolveCaa(name); | ||
} | ||
|
||
public resolveCname(name: string): Promise<string[]> { | ||
return resolveCname(name); | ||
} | ||
|
||
public resolveMx(name: string): Promise<MX[]> { | ||
return resolveMx(name); | ||
} | ||
|
||
public resolveNaptr(name: string): Promise<NAPTR[]> { | ||
return resolveNaptr(name); | ||
} | ||
|
||
public resolveNs(name: string): Promise<string[]> { | ||
return resolveNs(name); | ||
} | ||
|
||
public esolvePtr(name: string): Promise<string[]> { | ||
return resolvePtr(name); | ||
} | ||
|
||
public resolveSoa(name: string): Promise<SOA> { | ||
return resolveSoa(name); | ||
} | ||
|
||
public resolveSrv(name: string): Promise<SRV[]> { | ||
return resolveSrv(name); | ||
} | ||
|
||
public resolveTxt(name: string): Promise<string[][]> { | ||
return resolveTxt(name); | ||
} | ||
|
||
public reverse(name: string): Promise<string[]> { | ||
return reverse(name); | ||
} | ||
|
||
public setServers(): Promise<void> { | ||
return setServers(); | ||
} | ||
} | ||
|
||
export default { | ||
reverse, | ||
resolveTxt, | ||
resolveCaa, | ||
resolveMx, | ||
resolveCname, | ||
resolveNs, | ||
resolvePtr, | ||
resolveSrv, | ||
resolveSoa, | ||
resolveNaptr, | ||
resolve4, | ||
resolve6, | ||
getServers, | ||
setServers, | ||
getDefaultResultOrder, | ||
setDefaultResultOrder, | ||
lookup, | ||
lookupService, | ||
resolve, | ||
resolveAny, | ||
Resolver, | ||
...errorCodes, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters