@aws-sdk/client-sso 3.32.0 → 3.36.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/CHANGELOG.md +44 -0
- package/{dist/cjs → dist-cjs}/SSO.js +1 -2
- package/{dist/cjs → dist-cjs}/SSOClient.js +7 -8
- package/{dist/cjs → dist-cjs}/commands/GetRoleCredentialsCommand.js +2 -3
- package/{dist/cjs → dist-cjs}/commands/ListAccountRolesCommand.js +2 -3
- package/{dist/cjs → dist-cjs}/commands/ListAccountsCommand.js +2 -3
- package/{dist/cjs → dist-cjs}/commands/LogoutCommand.js +2 -3
- package/{dist/cjs → dist-cjs}/endpoints.js +0 -1
- package/{dist/cjs → dist-cjs}/index.js +0 -1
- package/{dist/cjs → dist-cjs}/models/index.js +0 -1
- package/{dist/cjs → dist-cjs}/models/models_0.js +0 -1
- package/{dist/cjs → dist-cjs}/pagination/Interfaces.js +0 -1
- package/{dist/cjs → dist-cjs}/pagination/ListAccountRolesPaginator.js +1 -2
- package/{dist/cjs → dist-cjs}/pagination/ListAccountsPaginator.js +1 -2
- package/{dist/cjs → dist-cjs}/protocols/Aws_restJson1.js +4 -5
- package/{dist/cjs → dist-cjs}/runtimeConfig.browser.js +2 -2
- package/{dist/cjs → dist-cjs}/runtimeConfig.js +2 -2
- package/{dist/cjs → dist-cjs}/runtimeConfig.native.js +0 -1
- package/{dist/cjs → dist-cjs}/runtimeConfig.shared.js +1 -2
- package/{dist/es → dist-es}/SSO.js +2 -21
- package/{dist/es → dist-es}/SSOClient.js +2 -26
- package/{dist/es → dist-es}/commands/GetRoleCredentialsCommand.js +4 -31
- package/{dist/es → dist-es}/commands/ListAccountRolesCommand.js +4 -30
- package/{dist/es → dist-es}/commands/ListAccountsCommand.js +4 -32
- package/{dist/es → dist-es}/commands/LogoutCommand.js +4 -30
- package/{dist/es → dist-es}/endpoints.js +1 -2
- package/{dist/types/index.d.ts → dist-es/index.js} +0 -0
- package/{dist/types/models/index.d.ts → dist-es/models/index.js} +0 -0
- package/{dist/es → dist-es}/models/models_0.js +0 -43
- package/dist-es/pagination/Interfaces.js +1 -0
- package/{dist/es → dist-es}/pagination/ListAccountRolesPaginator.js +17 -30
- package/{dist/es → dist-es}/pagination/ListAccountsPaginator.js +17 -30
- package/{dist/es → dist-es}/protocols/Aws_restJson1.js +96 -102
- package/{dist/es → dist-es}/runtimeConfig.browser.js +1 -5
- package/{dist/es → dist-es}/runtimeConfig.js +1 -5
- package/{dist/es → dist-es}/runtimeConfig.native.js +0 -4
- package/{dist/es → dist-es}/runtimeConfig.shared.js +1 -5
- package/{dist/types → dist-types}/SSO.d.ts +2 -2
- package/{dist/types → dist-types}/SSOClient.d.ts +5 -5
- package/{dist/types → dist-types}/commands/GetRoleCredentialsCommand.d.ts +3 -3
- package/{dist/types → dist-types}/commands/ListAccountRolesCommand.d.ts +3 -3
- package/{dist/types → dist-types}/commands/ListAccountsCommand.d.ts +3 -3
- package/{dist/types → dist-types}/commands/LogoutCommand.d.ts +3 -3
- package/{dist/types → dist-types}/endpoints.d.ts +0 -0
- package/{index.ts → dist-types/index.d.ts} +0 -0
- package/{models/index.ts → dist-types/models/index.d.ts} +0 -0
- package/{dist/types → dist-types}/models/models_0.d.ts +0 -0
- package/{dist/types → dist-types}/pagination/Interfaces.d.ts +1 -1
- package/{dist/types → dist-types}/pagination/ListAccountRolesPaginator.d.ts +1 -1
- package/{dist/types → dist-types}/pagination/ListAccountsPaginator.d.ts +1 -1
- package/{dist/types → dist-types}/protocols/Aws_restJson1.d.ts +2 -2
- package/{dist/types → dist-types}/runtimeConfig.browser.d.ts +0 -0
- package/{dist/types → dist-types}/runtimeConfig.d.ts +0 -0
- package/{dist/types → dist-types}/runtimeConfig.native.d.ts +0 -0
- package/{dist/types → dist-types}/runtimeConfig.shared.d.ts +0 -0
- package/{dist/types → dist-types}/ts3.4/SSO.d.ts +2 -2
- package/{dist/types → dist-types}/ts3.4/SSOClient.d.ts +5 -5
- package/{dist/types → dist-types}/ts3.4/commands/GetRoleCredentialsCommand.d.ts +3 -3
- package/{dist/types → dist-types}/ts3.4/commands/ListAccountRolesCommand.d.ts +3 -3
- package/{dist/types → dist-types}/ts3.4/commands/ListAccountsCommand.d.ts +3 -3
- package/{dist/types → dist-types}/ts3.4/commands/LogoutCommand.d.ts +3 -3
- package/{dist/types → dist-types}/ts3.4/endpoints.d.ts +0 -0
- package/{dist/types → dist-types}/ts3.4/index.d.ts +0 -0
- package/{dist/types → dist-types}/ts3.4/models/index.d.ts +0 -0
- package/{dist/types → dist-types}/ts3.4/models/models_0.d.ts +0 -0
- package/{dist/types → dist-types}/ts3.4/pagination/Interfaces.d.ts +1 -1
- package/{dist/types → dist-types}/ts3.4/pagination/ListAccountRolesPaginator.d.ts +1 -1
- package/{dist/types → dist-types}/ts3.4/pagination/ListAccountsPaginator.d.ts +1 -1
- package/{dist/types → dist-types}/ts3.4/protocols/Aws_restJson1.d.ts +2 -2
- package/{dist/types → dist-types}/ts3.4/runtimeConfig.browser.d.ts +0 -0
- package/{dist/types → dist-types}/ts3.4/runtimeConfig.d.ts +0 -0
- package/{dist/types → dist-types}/ts3.4/runtimeConfig.native.d.ts +0 -0
- package/{dist/types → dist-types}/ts3.4/runtimeConfig.shared.d.ts +0 -0
- package/package.json +49 -46
- package/SSO.ts +0 -160
- package/SSOClient.ts +0 -245
- package/commands/GetRoleCredentialsCommand.ts +0 -95
- package/commands/ListAccountRolesCommand.ts +0 -94
- package/commands/ListAccountsCommand.ts +0 -96
- package/commands/LogoutCommand.ts +0 -87
- package/dist/cjs/SSO.js.map +0 -1
- package/dist/cjs/SSOClient.js.map +0 -1
- package/dist/cjs/commands/GetRoleCredentialsCommand.js.map +0 -1
- package/dist/cjs/commands/ListAccountRolesCommand.js.map +0 -1
- package/dist/cjs/commands/ListAccountsCommand.js.map +0 -1
- package/dist/cjs/commands/LogoutCommand.js.map +0 -1
- package/dist/cjs/endpoints.js.map +0 -1
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/models/index.js.map +0 -1
- package/dist/cjs/models/models_0.js.map +0 -1
- package/dist/cjs/package.json +0 -88
- package/dist/cjs/pagination/Interfaces.js.map +0 -1
- package/dist/cjs/pagination/ListAccountRolesPaginator.js.map +0 -1
- package/dist/cjs/pagination/ListAccountsPaginator.js.map +0 -1
- package/dist/cjs/protocols/Aws_restJson1.js.map +0 -1
- package/dist/cjs/runtimeConfig.browser.js.map +0 -1
- package/dist/cjs/runtimeConfig.js.map +0 -1
- package/dist/cjs/runtimeConfig.native.js.map +0 -1
- package/dist/cjs/runtimeConfig.shared.js.map +0 -1
- package/dist/es/SSO.js.map +0 -1
- package/dist/es/SSOClient.js.map +0 -1
- package/dist/es/commands/GetRoleCredentialsCommand.js.map +0 -1
- package/dist/es/commands/ListAccountRolesCommand.js.map +0 -1
- package/dist/es/commands/ListAccountsCommand.js.map +0 -1
- package/dist/es/commands/LogoutCommand.js.map +0 -1
- package/dist/es/endpoints.js.map +0 -1
- package/dist/es/index.js +0 -11
- package/dist/es/index.js.map +0 -1
- package/dist/es/models/index.js +0 -2
- package/dist/es/models/index.js.map +0 -1
- package/dist/es/models/models_0.js.map +0 -1
- package/dist/es/package.json +0 -88
- package/dist/es/pagination/Interfaces.js +0 -2
- package/dist/es/pagination/Interfaces.js.map +0 -1
- package/dist/es/pagination/ListAccountRolesPaginator.js.map +0 -1
- package/dist/es/pagination/ListAccountsPaginator.js.map +0 -1
- package/dist/es/protocols/Aws_restJson1.js.map +0 -1
- package/dist/es/runtimeConfig.browser.js.map +0 -1
- package/dist/es/runtimeConfig.js.map +0 -1
- package/dist/es/runtimeConfig.native.js.map +0 -1
- package/dist/es/runtimeConfig.shared.js.map +0 -1
- package/endpoints.ts +0 -94
- package/jest.config.js +0 -4
- package/models/models_0.ts +0 -334
- package/pagination/Interfaces.ts +0 -7
- package/pagination/ListAccountRolesPaginator.ts +0 -58
- package/pagination/ListAccountsPaginator.ts +0 -58
- package/protocols/Aws_restJson1.ts +0 -621
- package/runtimeConfig.browser.ts +0 -38
- package/runtimeConfig.native.ts +0 -16
- package/runtimeConfig.shared.ts +0 -16
- package/runtimeConfig.ts +0 -41
- package/tsconfig.es.json +0 -12
- package/tsconfig.json +0 -32
|
@@ -1,621 +0,0 @@
|
|
|
1
|
-
import { GetRoleCredentialsCommandInput, GetRoleCredentialsCommandOutput } from "../commands/GetRoleCredentialsCommand";
|
|
2
|
-
import { ListAccountRolesCommandInput, ListAccountRolesCommandOutput } from "../commands/ListAccountRolesCommand";
|
|
3
|
-
import { ListAccountsCommandInput, ListAccountsCommandOutput } from "../commands/ListAccountsCommand";
|
|
4
|
-
import { LogoutCommandInput, LogoutCommandOutput } from "../commands/LogoutCommand";
|
|
5
|
-
import {
|
|
6
|
-
AccountInfo,
|
|
7
|
-
InvalidRequestException,
|
|
8
|
-
ResourceNotFoundException,
|
|
9
|
-
RoleCredentials,
|
|
10
|
-
RoleInfo,
|
|
11
|
-
TooManyRequestsException,
|
|
12
|
-
UnauthorizedException,
|
|
13
|
-
} from "../models/models_0";
|
|
14
|
-
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
|
|
15
|
-
import {
|
|
16
|
-
expectLong as __expectLong,
|
|
17
|
-
expectNonNull as __expectNonNull,
|
|
18
|
-
expectObject as __expectObject,
|
|
19
|
-
expectString as __expectString,
|
|
20
|
-
extendedEncodeURIComponent as __extendedEncodeURIComponent,
|
|
21
|
-
} from "@aws-sdk/smithy-client";
|
|
22
|
-
import {
|
|
23
|
-
Endpoint as __Endpoint,
|
|
24
|
-
MetadataBearer as __MetadataBearer,
|
|
25
|
-
ResponseMetadata as __ResponseMetadata,
|
|
26
|
-
SerdeContext as __SerdeContext,
|
|
27
|
-
SmithyException as __SmithyException,
|
|
28
|
-
} from "@aws-sdk/types";
|
|
29
|
-
|
|
30
|
-
export const serializeAws_restJson1GetRoleCredentialsCommand = async (
|
|
31
|
-
input: GetRoleCredentialsCommandInput,
|
|
32
|
-
context: __SerdeContext
|
|
33
|
-
): Promise<__HttpRequest> => {
|
|
34
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
35
|
-
const headers: any = {
|
|
36
|
-
...(isSerializableHeaderValue(input.accessToken) && { "x-amz-sso_bearer_token": input.accessToken! }),
|
|
37
|
-
};
|
|
38
|
-
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/federation/credentials";
|
|
39
|
-
const query: any = {
|
|
40
|
-
...(input.roleName !== undefined && { role_name: input.roleName }),
|
|
41
|
-
...(input.accountId !== undefined && { account_id: input.accountId }),
|
|
42
|
-
};
|
|
43
|
-
let body: any;
|
|
44
|
-
return new __HttpRequest({
|
|
45
|
-
protocol,
|
|
46
|
-
hostname,
|
|
47
|
-
port,
|
|
48
|
-
method: "GET",
|
|
49
|
-
headers,
|
|
50
|
-
path: resolvedPath,
|
|
51
|
-
query,
|
|
52
|
-
body,
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export const serializeAws_restJson1ListAccountRolesCommand = async (
|
|
57
|
-
input: ListAccountRolesCommandInput,
|
|
58
|
-
context: __SerdeContext
|
|
59
|
-
): Promise<__HttpRequest> => {
|
|
60
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
61
|
-
const headers: any = {
|
|
62
|
-
...(isSerializableHeaderValue(input.accessToken) && { "x-amz-sso_bearer_token": input.accessToken! }),
|
|
63
|
-
};
|
|
64
|
-
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assignment/roles";
|
|
65
|
-
const query: any = {
|
|
66
|
-
...(input.nextToken !== undefined && { next_token: input.nextToken }),
|
|
67
|
-
...(input.maxResults !== undefined && { max_result: input.maxResults.toString() }),
|
|
68
|
-
...(input.accountId !== undefined && { account_id: input.accountId }),
|
|
69
|
-
};
|
|
70
|
-
let body: any;
|
|
71
|
-
return new __HttpRequest({
|
|
72
|
-
protocol,
|
|
73
|
-
hostname,
|
|
74
|
-
port,
|
|
75
|
-
method: "GET",
|
|
76
|
-
headers,
|
|
77
|
-
path: resolvedPath,
|
|
78
|
-
query,
|
|
79
|
-
body,
|
|
80
|
-
});
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export const serializeAws_restJson1ListAccountsCommand = async (
|
|
84
|
-
input: ListAccountsCommandInput,
|
|
85
|
-
context: __SerdeContext
|
|
86
|
-
): Promise<__HttpRequest> => {
|
|
87
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
88
|
-
const headers: any = {
|
|
89
|
-
...(isSerializableHeaderValue(input.accessToken) && { "x-amz-sso_bearer_token": input.accessToken! }),
|
|
90
|
-
};
|
|
91
|
-
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assignment/accounts";
|
|
92
|
-
const query: any = {
|
|
93
|
-
...(input.nextToken !== undefined && { next_token: input.nextToken }),
|
|
94
|
-
...(input.maxResults !== undefined && { max_result: input.maxResults.toString() }),
|
|
95
|
-
};
|
|
96
|
-
let body: any;
|
|
97
|
-
return new __HttpRequest({
|
|
98
|
-
protocol,
|
|
99
|
-
hostname,
|
|
100
|
-
port,
|
|
101
|
-
method: "GET",
|
|
102
|
-
headers,
|
|
103
|
-
path: resolvedPath,
|
|
104
|
-
query,
|
|
105
|
-
body,
|
|
106
|
-
});
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
export const serializeAws_restJson1LogoutCommand = async (
|
|
110
|
-
input: LogoutCommandInput,
|
|
111
|
-
context: __SerdeContext
|
|
112
|
-
): Promise<__HttpRequest> => {
|
|
113
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
114
|
-
const headers: any = {
|
|
115
|
-
...(isSerializableHeaderValue(input.accessToken) && { "x-amz-sso_bearer_token": input.accessToken! }),
|
|
116
|
-
};
|
|
117
|
-
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/logout";
|
|
118
|
-
let body: any;
|
|
119
|
-
return new __HttpRequest({
|
|
120
|
-
protocol,
|
|
121
|
-
hostname,
|
|
122
|
-
port,
|
|
123
|
-
method: "POST",
|
|
124
|
-
headers,
|
|
125
|
-
path: resolvedPath,
|
|
126
|
-
body,
|
|
127
|
-
});
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
export const deserializeAws_restJson1GetRoleCredentialsCommand = async (
|
|
131
|
-
output: __HttpResponse,
|
|
132
|
-
context: __SerdeContext
|
|
133
|
-
): Promise<GetRoleCredentialsCommandOutput> => {
|
|
134
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
135
|
-
return deserializeAws_restJson1GetRoleCredentialsCommandError(output, context);
|
|
136
|
-
}
|
|
137
|
-
const contents: GetRoleCredentialsCommandOutput = {
|
|
138
|
-
$metadata: deserializeMetadata(output),
|
|
139
|
-
roleCredentials: undefined,
|
|
140
|
-
};
|
|
141
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
142
|
-
if (data.roleCredentials !== undefined && data.roleCredentials !== null) {
|
|
143
|
-
contents.roleCredentials = deserializeAws_restJson1RoleCredentials(data.roleCredentials, context);
|
|
144
|
-
}
|
|
145
|
-
return Promise.resolve(contents);
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
const deserializeAws_restJson1GetRoleCredentialsCommandError = async (
|
|
149
|
-
output: __HttpResponse,
|
|
150
|
-
context: __SerdeContext
|
|
151
|
-
): Promise<GetRoleCredentialsCommandOutput> => {
|
|
152
|
-
const parsedOutput: any = {
|
|
153
|
-
...output,
|
|
154
|
-
body: await parseBody(output.body, context),
|
|
155
|
-
};
|
|
156
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
157
|
-
let errorCode: string = "UnknownError";
|
|
158
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
159
|
-
switch (errorCode) {
|
|
160
|
-
case "InvalidRequestException":
|
|
161
|
-
case "com.amazonaws.sso#InvalidRequestException":
|
|
162
|
-
response = {
|
|
163
|
-
...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
|
|
164
|
-
name: errorCode,
|
|
165
|
-
$metadata: deserializeMetadata(output),
|
|
166
|
-
};
|
|
167
|
-
break;
|
|
168
|
-
case "ResourceNotFoundException":
|
|
169
|
-
case "com.amazonaws.sso#ResourceNotFoundException":
|
|
170
|
-
response = {
|
|
171
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
172
|
-
name: errorCode,
|
|
173
|
-
$metadata: deserializeMetadata(output),
|
|
174
|
-
};
|
|
175
|
-
break;
|
|
176
|
-
case "TooManyRequestsException":
|
|
177
|
-
case "com.amazonaws.sso#TooManyRequestsException":
|
|
178
|
-
response = {
|
|
179
|
-
...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
|
|
180
|
-
name: errorCode,
|
|
181
|
-
$metadata: deserializeMetadata(output),
|
|
182
|
-
};
|
|
183
|
-
break;
|
|
184
|
-
case "UnauthorizedException":
|
|
185
|
-
case "com.amazonaws.sso#UnauthorizedException":
|
|
186
|
-
response = {
|
|
187
|
-
...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
|
|
188
|
-
name: errorCode,
|
|
189
|
-
$metadata: deserializeMetadata(output),
|
|
190
|
-
};
|
|
191
|
-
break;
|
|
192
|
-
default:
|
|
193
|
-
const parsedBody = parsedOutput.body;
|
|
194
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
195
|
-
response = {
|
|
196
|
-
...parsedBody,
|
|
197
|
-
name: `${errorCode}`,
|
|
198
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
199
|
-
$fault: "client",
|
|
200
|
-
$metadata: deserializeMetadata(output),
|
|
201
|
-
} as any;
|
|
202
|
-
}
|
|
203
|
-
const message = response.message || response.Message || errorCode;
|
|
204
|
-
response.message = message;
|
|
205
|
-
delete response.Message;
|
|
206
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
export const deserializeAws_restJson1ListAccountRolesCommand = async (
|
|
210
|
-
output: __HttpResponse,
|
|
211
|
-
context: __SerdeContext
|
|
212
|
-
): Promise<ListAccountRolesCommandOutput> => {
|
|
213
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
214
|
-
return deserializeAws_restJson1ListAccountRolesCommandError(output, context);
|
|
215
|
-
}
|
|
216
|
-
const contents: ListAccountRolesCommandOutput = {
|
|
217
|
-
$metadata: deserializeMetadata(output),
|
|
218
|
-
nextToken: undefined,
|
|
219
|
-
roleList: undefined,
|
|
220
|
-
};
|
|
221
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
222
|
-
if (data.nextToken !== undefined && data.nextToken !== null) {
|
|
223
|
-
contents.nextToken = __expectString(data.nextToken);
|
|
224
|
-
}
|
|
225
|
-
if (data.roleList !== undefined && data.roleList !== null) {
|
|
226
|
-
contents.roleList = deserializeAws_restJson1RoleListType(data.roleList, context);
|
|
227
|
-
}
|
|
228
|
-
return Promise.resolve(contents);
|
|
229
|
-
};
|
|
230
|
-
|
|
231
|
-
const deserializeAws_restJson1ListAccountRolesCommandError = async (
|
|
232
|
-
output: __HttpResponse,
|
|
233
|
-
context: __SerdeContext
|
|
234
|
-
): Promise<ListAccountRolesCommandOutput> => {
|
|
235
|
-
const parsedOutput: any = {
|
|
236
|
-
...output,
|
|
237
|
-
body: await parseBody(output.body, context),
|
|
238
|
-
};
|
|
239
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
240
|
-
let errorCode: string = "UnknownError";
|
|
241
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
242
|
-
switch (errorCode) {
|
|
243
|
-
case "InvalidRequestException":
|
|
244
|
-
case "com.amazonaws.sso#InvalidRequestException":
|
|
245
|
-
response = {
|
|
246
|
-
...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
|
|
247
|
-
name: errorCode,
|
|
248
|
-
$metadata: deserializeMetadata(output),
|
|
249
|
-
};
|
|
250
|
-
break;
|
|
251
|
-
case "ResourceNotFoundException":
|
|
252
|
-
case "com.amazonaws.sso#ResourceNotFoundException":
|
|
253
|
-
response = {
|
|
254
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
255
|
-
name: errorCode,
|
|
256
|
-
$metadata: deserializeMetadata(output),
|
|
257
|
-
};
|
|
258
|
-
break;
|
|
259
|
-
case "TooManyRequestsException":
|
|
260
|
-
case "com.amazonaws.sso#TooManyRequestsException":
|
|
261
|
-
response = {
|
|
262
|
-
...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
|
|
263
|
-
name: errorCode,
|
|
264
|
-
$metadata: deserializeMetadata(output),
|
|
265
|
-
};
|
|
266
|
-
break;
|
|
267
|
-
case "UnauthorizedException":
|
|
268
|
-
case "com.amazonaws.sso#UnauthorizedException":
|
|
269
|
-
response = {
|
|
270
|
-
...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
|
|
271
|
-
name: errorCode,
|
|
272
|
-
$metadata: deserializeMetadata(output),
|
|
273
|
-
};
|
|
274
|
-
break;
|
|
275
|
-
default:
|
|
276
|
-
const parsedBody = parsedOutput.body;
|
|
277
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
278
|
-
response = {
|
|
279
|
-
...parsedBody,
|
|
280
|
-
name: `${errorCode}`,
|
|
281
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
282
|
-
$fault: "client",
|
|
283
|
-
$metadata: deserializeMetadata(output),
|
|
284
|
-
} as any;
|
|
285
|
-
}
|
|
286
|
-
const message = response.message || response.Message || errorCode;
|
|
287
|
-
response.message = message;
|
|
288
|
-
delete response.Message;
|
|
289
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
290
|
-
};
|
|
291
|
-
|
|
292
|
-
export const deserializeAws_restJson1ListAccountsCommand = async (
|
|
293
|
-
output: __HttpResponse,
|
|
294
|
-
context: __SerdeContext
|
|
295
|
-
): Promise<ListAccountsCommandOutput> => {
|
|
296
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
297
|
-
return deserializeAws_restJson1ListAccountsCommandError(output, context);
|
|
298
|
-
}
|
|
299
|
-
const contents: ListAccountsCommandOutput = {
|
|
300
|
-
$metadata: deserializeMetadata(output),
|
|
301
|
-
accountList: undefined,
|
|
302
|
-
nextToken: undefined,
|
|
303
|
-
};
|
|
304
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
305
|
-
if (data.accountList !== undefined && data.accountList !== null) {
|
|
306
|
-
contents.accountList = deserializeAws_restJson1AccountListType(data.accountList, context);
|
|
307
|
-
}
|
|
308
|
-
if (data.nextToken !== undefined && data.nextToken !== null) {
|
|
309
|
-
contents.nextToken = __expectString(data.nextToken);
|
|
310
|
-
}
|
|
311
|
-
return Promise.resolve(contents);
|
|
312
|
-
};
|
|
313
|
-
|
|
314
|
-
const deserializeAws_restJson1ListAccountsCommandError = async (
|
|
315
|
-
output: __HttpResponse,
|
|
316
|
-
context: __SerdeContext
|
|
317
|
-
): Promise<ListAccountsCommandOutput> => {
|
|
318
|
-
const parsedOutput: any = {
|
|
319
|
-
...output,
|
|
320
|
-
body: await parseBody(output.body, context),
|
|
321
|
-
};
|
|
322
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
323
|
-
let errorCode: string = "UnknownError";
|
|
324
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
325
|
-
switch (errorCode) {
|
|
326
|
-
case "InvalidRequestException":
|
|
327
|
-
case "com.amazonaws.sso#InvalidRequestException":
|
|
328
|
-
response = {
|
|
329
|
-
...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
|
|
330
|
-
name: errorCode,
|
|
331
|
-
$metadata: deserializeMetadata(output),
|
|
332
|
-
};
|
|
333
|
-
break;
|
|
334
|
-
case "ResourceNotFoundException":
|
|
335
|
-
case "com.amazonaws.sso#ResourceNotFoundException":
|
|
336
|
-
response = {
|
|
337
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
338
|
-
name: errorCode,
|
|
339
|
-
$metadata: deserializeMetadata(output),
|
|
340
|
-
};
|
|
341
|
-
break;
|
|
342
|
-
case "TooManyRequestsException":
|
|
343
|
-
case "com.amazonaws.sso#TooManyRequestsException":
|
|
344
|
-
response = {
|
|
345
|
-
...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
|
|
346
|
-
name: errorCode,
|
|
347
|
-
$metadata: deserializeMetadata(output),
|
|
348
|
-
};
|
|
349
|
-
break;
|
|
350
|
-
case "UnauthorizedException":
|
|
351
|
-
case "com.amazonaws.sso#UnauthorizedException":
|
|
352
|
-
response = {
|
|
353
|
-
...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
|
|
354
|
-
name: errorCode,
|
|
355
|
-
$metadata: deserializeMetadata(output),
|
|
356
|
-
};
|
|
357
|
-
break;
|
|
358
|
-
default:
|
|
359
|
-
const parsedBody = parsedOutput.body;
|
|
360
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
361
|
-
response = {
|
|
362
|
-
...parsedBody,
|
|
363
|
-
name: `${errorCode}`,
|
|
364
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
365
|
-
$fault: "client",
|
|
366
|
-
$metadata: deserializeMetadata(output),
|
|
367
|
-
} as any;
|
|
368
|
-
}
|
|
369
|
-
const message = response.message || response.Message || errorCode;
|
|
370
|
-
response.message = message;
|
|
371
|
-
delete response.Message;
|
|
372
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
373
|
-
};
|
|
374
|
-
|
|
375
|
-
export const deserializeAws_restJson1LogoutCommand = async (
|
|
376
|
-
output: __HttpResponse,
|
|
377
|
-
context: __SerdeContext
|
|
378
|
-
): Promise<LogoutCommandOutput> => {
|
|
379
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
380
|
-
return deserializeAws_restJson1LogoutCommandError(output, context);
|
|
381
|
-
}
|
|
382
|
-
const contents: LogoutCommandOutput = {
|
|
383
|
-
$metadata: deserializeMetadata(output),
|
|
384
|
-
};
|
|
385
|
-
await collectBody(output.body, context);
|
|
386
|
-
return Promise.resolve(contents);
|
|
387
|
-
};
|
|
388
|
-
|
|
389
|
-
const deserializeAws_restJson1LogoutCommandError = async (
|
|
390
|
-
output: __HttpResponse,
|
|
391
|
-
context: __SerdeContext
|
|
392
|
-
): Promise<LogoutCommandOutput> => {
|
|
393
|
-
const parsedOutput: any = {
|
|
394
|
-
...output,
|
|
395
|
-
body: await parseBody(output.body, context),
|
|
396
|
-
};
|
|
397
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
398
|
-
let errorCode: string = "UnknownError";
|
|
399
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
400
|
-
switch (errorCode) {
|
|
401
|
-
case "InvalidRequestException":
|
|
402
|
-
case "com.amazonaws.sso#InvalidRequestException":
|
|
403
|
-
response = {
|
|
404
|
-
...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
|
|
405
|
-
name: errorCode,
|
|
406
|
-
$metadata: deserializeMetadata(output),
|
|
407
|
-
};
|
|
408
|
-
break;
|
|
409
|
-
case "TooManyRequestsException":
|
|
410
|
-
case "com.amazonaws.sso#TooManyRequestsException":
|
|
411
|
-
response = {
|
|
412
|
-
...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
|
|
413
|
-
name: errorCode,
|
|
414
|
-
$metadata: deserializeMetadata(output),
|
|
415
|
-
};
|
|
416
|
-
break;
|
|
417
|
-
case "UnauthorizedException":
|
|
418
|
-
case "com.amazonaws.sso#UnauthorizedException":
|
|
419
|
-
response = {
|
|
420
|
-
...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
|
|
421
|
-
name: errorCode,
|
|
422
|
-
$metadata: deserializeMetadata(output),
|
|
423
|
-
};
|
|
424
|
-
break;
|
|
425
|
-
default:
|
|
426
|
-
const parsedBody = parsedOutput.body;
|
|
427
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
428
|
-
response = {
|
|
429
|
-
...parsedBody,
|
|
430
|
-
name: `${errorCode}`,
|
|
431
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
432
|
-
$fault: "client",
|
|
433
|
-
$metadata: deserializeMetadata(output),
|
|
434
|
-
} as any;
|
|
435
|
-
}
|
|
436
|
-
const message = response.message || response.Message || errorCode;
|
|
437
|
-
response.message = message;
|
|
438
|
-
delete response.Message;
|
|
439
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
440
|
-
};
|
|
441
|
-
|
|
442
|
-
const deserializeAws_restJson1InvalidRequestExceptionResponse = async (
|
|
443
|
-
parsedOutput: any,
|
|
444
|
-
context: __SerdeContext
|
|
445
|
-
): Promise<InvalidRequestException> => {
|
|
446
|
-
const contents: InvalidRequestException = {
|
|
447
|
-
name: "InvalidRequestException",
|
|
448
|
-
$fault: "client",
|
|
449
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
450
|
-
message: undefined,
|
|
451
|
-
};
|
|
452
|
-
const data: any = parsedOutput.body;
|
|
453
|
-
if (data.message !== undefined && data.message !== null) {
|
|
454
|
-
contents.message = __expectString(data.message);
|
|
455
|
-
}
|
|
456
|
-
return contents;
|
|
457
|
-
};
|
|
458
|
-
|
|
459
|
-
const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (
|
|
460
|
-
parsedOutput: any,
|
|
461
|
-
context: __SerdeContext
|
|
462
|
-
): Promise<ResourceNotFoundException> => {
|
|
463
|
-
const contents: ResourceNotFoundException = {
|
|
464
|
-
name: "ResourceNotFoundException",
|
|
465
|
-
$fault: "client",
|
|
466
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
467
|
-
message: undefined,
|
|
468
|
-
};
|
|
469
|
-
const data: any = parsedOutput.body;
|
|
470
|
-
if (data.message !== undefined && data.message !== null) {
|
|
471
|
-
contents.message = __expectString(data.message);
|
|
472
|
-
}
|
|
473
|
-
return contents;
|
|
474
|
-
};
|
|
475
|
-
|
|
476
|
-
const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (
|
|
477
|
-
parsedOutput: any,
|
|
478
|
-
context: __SerdeContext
|
|
479
|
-
): Promise<TooManyRequestsException> => {
|
|
480
|
-
const contents: TooManyRequestsException = {
|
|
481
|
-
name: "TooManyRequestsException",
|
|
482
|
-
$fault: "client",
|
|
483
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
484
|
-
message: undefined,
|
|
485
|
-
};
|
|
486
|
-
const data: any = parsedOutput.body;
|
|
487
|
-
if (data.message !== undefined && data.message !== null) {
|
|
488
|
-
contents.message = __expectString(data.message);
|
|
489
|
-
}
|
|
490
|
-
return contents;
|
|
491
|
-
};
|
|
492
|
-
|
|
493
|
-
const deserializeAws_restJson1UnauthorizedExceptionResponse = async (
|
|
494
|
-
parsedOutput: any,
|
|
495
|
-
context: __SerdeContext
|
|
496
|
-
): Promise<UnauthorizedException> => {
|
|
497
|
-
const contents: UnauthorizedException = {
|
|
498
|
-
name: "UnauthorizedException",
|
|
499
|
-
$fault: "client",
|
|
500
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
501
|
-
message: undefined,
|
|
502
|
-
};
|
|
503
|
-
const data: any = parsedOutput.body;
|
|
504
|
-
if (data.message !== undefined && data.message !== null) {
|
|
505
|
-
contents.message = __expectString(data.message);
|
|
506
|
-
}
|
|
507
|
-
return contents;
|
|
508
|
-
};
|
|
509
|
-
|
|
510
|
-
const deserializeAws_restJson1AccountInfo = (output: any, context: __SerdeContext): AccountInfo => {
|
|
511
|
-
return {
|
|
512
|
-
accountId: __expectString(output.accountId),
|
|
513
|
-
accountName: __expectString(output.accountName),
|
|
514
|
-
emailAddress: __expectString(output.emailAddress),
|
|
515
|
-
} as any;
|
|
516
|
-
};
|
|
517
|
-
|
|
518
|
-
const deserializeAws_restJson1AccountListType = (output: any, context: __SerdeContext): AccountInfo[] => {
|
|
519
|
-
return (output || [])
|
|
520
|
-
.filter((e: any) => e != null)
|
|
521
|
-
.map((entry: any) => {
|
|
522
|
-
if (entry === null) {
|
|
523
|
-
return null as any;
|
|
524
|
-
}
|
|
525
|
-
return deserializeAws_restJson1AccountInfo(entry, context);
|
|
526
|
-
});
|
|
527
|
-
};
|
|
528
|
-
|
|
529
|
-
const deserializeAws_restJson1RoleCredentials = (output: any, context: __SerdeContext): RoleCredentials => {
|
|
530
|
-
return {
|
|
531
|
-
accessKeyId: __expectString(output.accessKeyId),
|
|
532
|
-
expiration: __expectLong(output.expiration),
|
|
533
|
-
secretAccessKey: __expectString(output.secretAccessKey),
|
|
534
|
-
sessionToken: __expectString(output.sessionToken),
|
|
535
|
-
} as any;
|
|
536
|
-
};
|
|
537
|
-
|
|
538
|
-
const deserializeAws_restJson1RoleInfo = (output: any, context: __SerdeContext): RoleInfo => {
|
|
539
|
-
return {
|
|
540
|
-
accountId: __expectString(output.accountId),
|
|
541
|
-
roleName: __expectString(output.roleName),
|
|
542
|
-
} as any;
|
|
543
|
-
};
|
|
544
|
-
|
|
545
|
-
const deserializeAws_restJson1RoleListType = (output: any, context: __SerdeContext): RoleInfo[] => {
|
|
546
|
-
return (output || [])
|
|
547
|
-
.filter((e: any) => e != null)
|
|
548
|
-
.map((entry: any) => {
|
|
549
|
-
if (entry === null) {
|
|
550
|
-
return null as any;
|
|
551
|
-
}
|
|
552
|
-
return deserializeAws_restJson1RoleInfo(entry, context);
|
|
553
|
-
});
|
|
554
|
-
};
|
|
555
|
-
|
|
556
|
-
const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
|
|
557
|
-
httpStatusCode: output.statusCode,
|
|
558
|
-
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
|
|
559
|
-
extendedRequestId: output.headers["x-amz-id-2"],
|
|
560
|
-
cfId: output.headers["x-amz-cf-id"],
|
|
561
|
-
});
|
|
562
|
-
|
|
563
|
-
// Collect low-level response body stream to Uint8Array.
|
|
564
|
-
const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
|
|
565
|
-
if (streamBody instanceof Uint8Array) {
|
|
566
|
-
return Promise.resolve(streamBody);
|
|
567
|
-
}
|
|
568
|
-
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
569
|
-
};
|
|
570
|
-
|
|
571
|
-
// Encode Uint8Array data into string with utf-8.
|
|
572
|
-
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
|
|
573
|
-
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
574
|
-
|
|
575
|
-
const isSerializableHeaderValue = (value: any): boolean =>
|
|
576
|
-
value !== undefined &&
|
|
577
|
-
value !== null &&
|
|
578
|
-
value !== "" &&
|
|
579
|
-
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
580
|
-
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
581
|
-
|
|
582
|
-
const parseBody = (streamBody: any, context: __SerdeContext): any =>
|
|
583
|
-
collectBodyString(streamBody, context).then((encoded) => {
|
|
584
|
-
if (encoded.length) {
|
|
585
|
-
return JSON.parse(encoded);
|
|
586
|
-
}
|
|
587
|
-
return {};
|
|
588
|
-
});
|
|
589
|
-
|
|
590
|
-
/**
|
|
591
|
-
* Load an error code for the aws.rest-json-1.1 protocol.
|
|
592
|
-
*/
|
|
593
|
-
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {
|
|
594
|
-
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
595
|
-
|
|
596
|
-
const sanitizeErrorCode = (rawValue: string): string => {
|
|
597
|
-
let cleanValue = rawValue;
|
|
598
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
599
|
-
cleanValue = cleanValue.split(":")[0];
|
|
600
|
-
}
|
|
601
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
602
|
-
cleanValue = cleanValue.split("#")[1];
|
|
603
|
-
}
|
|
604
|
-
return cleanValue;
|
|
605
|
-
};
|
|
606
|
-
|
|
607
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
608
|
-
if (headerKey !== undefined) {
|
|
609
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
if (data.code !== undefined) {
|
|
613
|
-
return sanitizeErrorCode(data.code);
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
if (data["__type"] !== undefined) {
|
|
617
|
-
return sanitizeErrorCode(data["__type"]);
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
return "";
|
|
621
|
-
};
|
package/runtimeConfig.browser.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import packageInfo from "./package.json";
|
|
2
|
-
|
|
3
|
-
import { Sha256 } from "@aws-crypto/sha256-browser";
|
|
4
|
-
import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler";
|
|
5
|
-
import { invalidProvider } from "@aws-sdk/invalid-dependency";
|
|
6
|
-
import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry";
|
|
7
|
-
import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser";
|
|
8
|
-
import { calculateBodyLength } from "@aws-sdk/util-body-length-browser";
|
|
9
|
-
import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser";
|
|
10
|
-
import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser";
|
|
11
|
-
import { SSOClientConfig } from "./SSOClient";
|
|
12
|
-
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @internal
|
|
16
|
-
*/
|
|
17
|
-
export const getRuntimeConfig = (config: SSOClientConfig) => {
|
|
18
|
-
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
19
|
-
return {
|
|
20
|
-
...clientSharedValues,
|
|
21
|
-
...config,
|
|
22
|
-
runtime: "browser",
|
|
23
|
-
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
24
|
-
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
25
|
-
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
26
|
-
defaultUserAgentProvider:
|
|
27
|
-
config?.defaultUserAgentProvider ??
|
|
28
|
-
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
29
|
-
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
|
|
30
|
-
region: config?.region ?? invalidProvider("Region is missing"),
|
|
31
|
-
requestHandler: config?.requestHandler ?? new FetchHttpHandler(),
|
|
32
|
-
retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)),
|
|
33
|
-
sha256: config?.sha256 ?? Sha256,
|
|
34
|
-
streamCollector: config?.streamCollector ?? streamCollector,
|
|
35
|
-
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
36
|
-
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
37
|
-
};
|
|
38
|
-
};
|
package/runtimeConfig.native.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Sha256 } from "@aws-crypto/sha256-js";
|
|
2
|
-
import { SSOClientConfig } from "./SSOClient";
|
|
3
|
-
import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @internal
|
|
7
|
-
*/
|
|
8
|
-
export const getRuntimeConfig = (config: SSOClientConfig) => {
|
|
9
|
-
const browserDefaults = getBrowserRuntimeConfig(config);
|
|
10
|
-
return {
|
|
11
|
-
...browserDefaults,
|
|
12
|
-
...config,
|
|
13
|
-
runtime: "react-native",
|
|
14
|
-
sha256: config?.sha256 ?? Sha256,
|
|
15
|
-
};
|
|
16
|
-
};
|
package/runtimeConfig.shared.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { defaultRegionInfoProvider } from "./endpoints";
|
|
2
|
-
import { Logger as __Logger } from "@aws-sdk/types";
|
|
3
|
-
import { parseUrl } from "@aws-sdk/url-parser";
|
|
4
|
-
import { SSOClientConfig } from "./SSOClient";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export const getRuntimeConfig = (config: SSOClientConfig) => ({
|
|
10
|
-
apiVersion: "2019-06-10",
|
|
11
|
-
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
12
|
-
logger: config?.logger ?? ({} as __Logger),
|
|
13
|
-
regionInfoProvider: config?.regionInfoProvider ?? defaultRegionInfoProvider,
|
|
14
|
-
serviceId: config?.serviceId ?? "SSO",
|
|
15
|
-
urlParser: config?.urlParser ?? parseUrl,
|
|
16
|
-
});
|