Skip to content

Commit 9303f03

Browse files
committed
chore(config-resolver): define options in each file
1 parent 0f7da55 commit 9303f03

File tree

6 files changed

+26
-19
lines changed

6 files changed

+26
-19
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* The hash of partition with the information specific to that partition.
3+
* The information includes the list of regions belonging to that partition,
4+
* and the hostname to be used for the partition.
5+
*/
16
export type PartitionHash = {
27
[key: string]: { regions: string[]; hostname?: string; endpoint?: string };
38
};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
import { RegionInfo } from "@aws-sdk/types";
22

3+
/**
4+
* The hash of region with the information specific to that region.
5+
* The information can include hostname, signingService and signingRegion.
6+
*/
37
export type RegionHash = { [key: string]: Partial<Omit<RegionInfo, "partition" | "path">> };

packages/config-resolver/src/regionInfo/getHostnameTemplate.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import { getResolvedPartition, GetResolvedPartitionOptions } from "./getResolvedPartition";
1+
import { getResolvedPartition } from "./getResolvedPartition";
2+
import { PartitionHash } from "./PartitionHash";
23

34
const AWS_TEMPLATE = "{signingService}.{region}.amazonaws.com";
45

5-
export interface GetHostnameTemplateOptions extends GetResolvedPartitionOptions {
6-
/**
7-
* The name to be used while signing the service request.
8-
*/
6+
export interface GetHostnameTemplateOptions {
97
signingService: string;
8+
partitionHash: PartitionHash;
109
}
1110

1211
export const getHostnameTemplate = (region: string, { signingService, partitionHash }: GetHostnameTemplateOptions) =>

packages/config-resolver/src/regionInfo/getRegionInfo.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
import { RegionInfo } from "@aws-sdk/types";
22

3-
import { getResolvedHostname, GetResolvedHostnameOptions } from "./getResolvedHostname";
3+
import { getResolvedHostname } from "./getResolvedHostname";
44
import { getResolvedPartition } from "./getResolvedPartition";
5+
import { PartitionHash } from "./PartitionHash";
6+
import { RegionHash } from "./RegionHash";
57

6-
export interface GetRegionInfoOptions extends GetResolvedHostnameOptions {}
8+
export interface GetRegionInfoOptions {
9+
signingService: string;
10+
regionHash: RegionHash;
11+
partitionHash: PartitionHash;
12+
}
713

814
export const getRegionInfo = (
915
region: string,

packages/config-resolver/src/regionInfo/getResolvedHostname.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
import { getHostnameTemplate, GetHostnameTemplateOptions } from "./getHostnameTemplate";
2-
import { GetResolvedPartitionOptions } from "./getResolvedPartition";
1+
import { getHostnameTemplate } from "./getHostnameTemplate";
2+
import { PartitionHash } from "./PartitionHash";
33
import { RegionHash } from "./RegionHash";
44

5-
export interface GetResolvedHostnameOptions extends GetHostnameTemplateOptions, GetResolvedPartitionOptions {
6-
/**
7-
* The hash of region with the information specific to that region.
8-
* The information can include hostname, signingService and signingRegion.
9-
*/
5+
export interface GetResolvedHostnameOptions {
6+
signingService: string;
107
regionHash: RegionHash;
8+
partitionHash: PartitionHash;
119
}
1210

1311
export const getResolvedHostname = (

packages/config-resolver/src/regionInfo/getResolvedPartition.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
import { PartitionHash } from "./PartitionHash";
22

33
export interface GetResolvedPartitionOptions {
4-
/**
5-
* The hash of partition with the information specific to that partition.
6-
* The information includes the list of regions belonging to that partition,
7-
* and the hostname to be used for the partition.
8-
*/
94
partitionHash: PartitionHash;
105
}
116

0 commit comments

Comments
 (0)