@aws-sdk/client-sso 3.490.0 → 3.495.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/SSO.js +1 -19
- package/dist-cjs/SSOClient.js +1 -40
- package/dist-cjs/commands/GetRoleCredentialsCommand.js +1 -29
- package/dist-cjs/commands/ListAccountRolesCommand.js +1 -29
- package/dist-cjs/commands/ListAccountsCommand.js +1 -29
- package/dist-cjs/commands/LogoutCommand.js +1 -29
- package/dist-cjs/commands/index.js +1 -7
- package/dist-cjs/endpoint/EndpointParameters.js +1 -18
- package/dist-cjs/extensionConfiguration.js +1 -2
- package/dist-cjs/index.js +689 -11
- package/dist-cjs/models/SSOServiceException.js +1 -12
- package/dist-cjs/models/index.js +1 -4
- package/dist-cjs/models/models_0.js +1 -88
- package/dist-cjs/pagination/Interfaces.js +1 -2
- package/dist-cjs/pagination/ListAccountRolesPaginator.js +1 -7
- package/dist-cjs/pagination/ListAccountsPaginator.js +1 -7
- package/dist-cjs/pagination/index.js +1 -6
- package/dist-cjs/protocols/Aws_restJson1.js +1 -346
- package/dist-cjs/runtimeExtensions.js +1 -22
- package/package.json +37 -37
package/dist-cjs/index.js
CHANGED
|
@@ -1,12 +1,690 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/index.ts
|
|
22
|
+
var src_exports = {};
|
|
23
|
+
__export(src_exports, {
|
|
24
|
+
GetRoleCredentialsCommand: () => GetRoleCredentialsCommand,
|
|
25
|
+
GetRoleCredentialsRequestFilterSensitiveLog: () => GetRoleCredentialsRequestFilterSensitiveLog,
|
|
26
|
+
GetRoleCredentialsResponseFilterSensitiveLog: () => GetRoleCredentialsResponseFilterSensitiveLog,
|
|
27
|
+
InvalidRequestException: () => InvalidRequestException,
|
|
28
|
+
ListAccountRolesCommand: () => ListAccountRolesCommand,
|
|
29
|
+
ListAccountRolesRequestFilterSensitiveLog: () => ListAccountRolesRequestFilterSensitiveLog,
|
|
30
|
+
ListAccountsCommand: () => ListAccountsCommand,
|
|
31
|
+
ListAccountsRequestFilterSensitiveLog: () => ListAccountsRequestFilterSensitiveLog,
|
|
32
|
+
LogoutCommand: () => LogoutCommand,
|
|
33
|
+
LogoutRequestFilterSensitiveLog: () => LogoutRequestFilterSensitiveLog,
|
|
34
|
+
ResourceNotFoundException: () => ResourceNotFoundException,
|
|
35
|
+
RoleCredentialsFilterSensitiveLog: () => RoleCredentialsFilterSensitiveLog,
|
|
36
|
+
SSO: () => SSO,
|
|
37
|
+
SSOClient: () => SSOClient,
|
|
38
|
+
SSOServiceException: () => SSOServiceException,
|
|
39
|
+
TooManyRequestsException: () => TooManyRequestsException,
|
|
40
|
+
UnauthorizedException: () => UnauthorizedException,
|
|
41
|
+
__Client: () => import_smithy_client.Client,
|
|
42
|
+
paginateListAccountRoles: () => paginateListAccountRoles,
|
|
43
|
+
paginateListAccounts: () => paginateListAccounts
|
|
44
|
+
});
|
|
45
|
+
module.exports = __toCommonJS(src_exports);
|
|
46
|
+
|
|
47
|
+
// src/SSOClient.ts
|
|
48
|
+
var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
|
|
49
|
+
var import_middleware_logger = require("@aws-sdk/middleware-logger");
|
|
50
|
+
var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
|
|
51
|
+
var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
|
|
52
|
+
var import_config_resolver = require("@smithy/config-resolver");
|
|
53
|
+
var import_middleware_content_length = require("@smithy/middleware-content-length");
|
|
54
|
+
var import_middleware_endpoint = require("@smithy/middleware-endpoint");
|
|
55
|
+
var import_middleware_retry = require("@smithy/middleware-retry");
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
// src/endpoint/EndpointParameters.ts
|
|
59
|
+
var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
|
|
60
|
+
return {
|
|
61
|
+
...options,
|
|
62
|
+
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
|
|
63
|
+
useFipsEndpoint: options.useFipsEndpoint ?? false,
|
|
64
|
+
defaultSigningName: "awsssoportal"
|
|
65
|
+
};
|
|
66
|
+
}, "resolveClientEndpointParameters");
|
|
67
|
+
var commonParams = {
|
|
68
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
69
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
70
|
+
Region: { type: "builtInParams", name: "region" },
|
|
71
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
// src/SSOClient.ts
|
|
75
|
+
var import_runtimeConfig = require("././runtimeConfig");
|
|
76
|
+
|
|
77
|
+
// src/runtimeExtensions.ts
|
|
78
|
+
var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
|
|
79
|
+
var import_protocol_http = require("@smithy/protocol-http");
|
|
80
|
+
var import_smithy_client = require("@smithy/smithy-client");
|
|
81
|
+
var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial");
|
|
82
|
+
var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
|
|
83
|
+
const extensionConfiguration = {
|
|
84
|
+
...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)),
|
|
85
|
+
...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)),
|
|
86
|
+
...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig))
|
|
87
|
+
};
|
|
88
|
+
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
89
|
+
return {
|
|
90
|
+
...runtimeConfig,
|
|
91
|
+
...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
|
|
92
|
+
...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
|
|
93
|
+
...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration)
|
|
94
|
+
};
|
|
95
|
+
}, "resolveRuntimeExtensions");
|
|
96
|
+
|
|
97
|
+
// src/SSOClient.ts
|
|
98
|
+
var _SSOClient = class _SSOClient extends import_smithy_client.Client {
|
|
99
|
+
constructor(...[configuration]) {
|
|
100
|
+
const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
|
|
101
|
+
const _config_1 = resolveClientEndpointParameters(_config_0);
|
|
102
|
+
const _config_2 = (0, import_config_resolver.resolveRegionConfig)(_config_1);
|
|
103
|
+
const _config_3 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_2);
|
|
104
|
+
const _config_4 = (0, import_middleware_retry.resolveRetryConfig)(_config_3);
|
|
105
|
+
const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
|
|
106
|
+
const _config_6 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_5);
|
|
107
|
+
const _config_7 = resolveRuntimeExtensions(_config_6, (configuration == null ? void 0 : configuration.extensions) || []);
|
|
108
|
+
super(_config_7);
|
|
109
|
+
this.config = _config_7;
|
|
110
|
+
this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
|
|
111
|
+
this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
|
|
112
|
+
this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
|
|
113
|
+
this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
|
|
114
|
+
this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
|
|
115
|
+
this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Destroy underlying resources, like sockets. It's usually not necessary to do this.
|
|
119
|
+
* However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
|
|
120
|
+
* Otherwise, sockets might stay open for quite a long time before the server terminates them.
|
|
121
|
+
*/
|
|
122
|
+
destroy() {
|
|
123
|
+
super.destroy();
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
__name(_SSOClient, "SSOClient");
|
|
127
|
+
var SSOClient = _SSOClient;
|
|
128
|
+
|
|
129
|
+
// src/SSO.ts
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
// src/commands/GetRoleCredentialsCommand.ts
|
|
133
|
+
|
|
134
|
+
var import_middleware_serde = require("@smithy/middleware-serde");
|
|
135
|
+
|
|
136
|
+
var import_types = require("@smithy/types");
|
|
137
|
+
|
|
138
|
+
// src/models/models_0.ts
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
// src/models/SSOServiceException.ts
|
|
142
|
+
|
|
143
|
+
var _SSOServiceException = class _SSOServiceException extends import_smithy_client.ServiceException {
|
|
144
|
+
/**
|
|
145
|
+
* @internal
|
|
146
|
+
*/
|
|
147
|
+
constructor(options) {
|
|
148
|
+
super(options);
|
|
149
|
+
Object.setPrototypeOf(this, _SSOServiceException.prototype);
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
__name(_SSOServiceException, "SSOServiceException");
|
|
153
|
+
var SSOServiceException = _SSOServiceException;
|
|
154
|
+
|
|
155
|
+
// src/models/models_0.ts
|
|
156
|
+
var _InvalidRequestException = class _InvalidRequestException extends SSOServiceException {
|
|
157
|
+
/**
|
|
158
|
+
* @internal
|
|
159
|
+
*/
|
|
160
|
+
constructor(opts) {
|
|
161
|
+
super({
|
|
162
|
+
name: "InvalidRequestException",
|
|
163
|
+
$fault: "client",
|
|
164
|
+
...opts
|
|
165
|
+
});
|
|
166
|
+
this.name = "InvalidRequestException";
|
|
167
|
+
this.$fault = "client";
|
|
168
|
+
Object.setPrototypeOf(this, _InvalidRequestException.prototype);
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
__name(_InvalidRequestException, "InvalidRequestException");
|
|
172
|
+
var InvalidRequestException = _InvalidRequestException;
|
|
173
|
+
var _ResourceNotFoundException = class _ResourceNotFoundException extends SSOServiceException {
|
|
174
|
+
/**
|
|
175
|
+
* @internal
|
|
176
|
+
*/
|
|
177
|
+
constructor(opts) {
|
|
178
|
+
super({
|
|
179
|
+
name: "ResourceNotFoundException",
|
|
180
|
+
$fault: "client",
|
|
181
|
+
...opts
|
|
182
|
+
});
|
|
183
|
+
this.name = "ResourceNotFoundException";
|
|
184
|
+
this.$fault = "client";
|
|
185
|
+
Object.setPrototypeOf(this, _ResourceNotFoundException.prototype);
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
__name(_ResourceNotFoundException, "ResourceNotFoundException");
|
|
189
|
+
var ResourceNotFoundException = _ResourceNotFoundException;
|
|
190
|
+
var _TooManyRequestsException = class _TooManyRequestsException extends SSOServiceException {
|
|
191
|
+
/**
|
|
192
|
+
* @internal
|
|
193
|
+
*/
|
|
194
|
+
constructor(opts) {
|
|
195
|
+
super({
|
|
196
|
+
name: "TooManyRequestsException",
|
|
197
|
+
$fault: "client",
|
|
198
|
+
...opts
|
|
199
|
+
});
|
|
200
|
+
this.name = "TooManyRequestsException";
|
|
201
|
+
this.$fault = "client";
|
|
202
|
+
Object.setPrototypeOf(this, _TooManyRequestsException.prototype);
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
__name(_TooManyRequestsException, "TooManyRequestsException");
|
|
206
|
+
var TooManyRequestsException = _TooManyRequestsException;
|
|
207
|
+
var _UnauthorizedException = class _UnauthorizedException extends SSOServiceException {
|
|
208
|
+
/**
|
|
209
|
+
* @internal
|
|
210
|
+
*/
|
|
211
|
+
constructor(opts) {
|
|
212
|
+
super({
|
|
213
|
+
name: "UnauthorizedException",
|
|
214
|
+
$fault: "client",
|
|
215
|
+
...opts
|
|
216
|
+
});
|
|
217
|
+
this.name = "UnauthorizedException";
|
|
218
|
+
this.$fault = "client";
|
|
219
|
+
Object.setPrototypeOf(this, _UnauthorizedException.prototype);
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
__name(_UnauthorizedException, "UnauthorizedException");
|
|
223
|
+
var UnauthorizedException = _UnauthorizedException;
|
|
224
|
+
var GetRoleCredentialsRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
225
|
+
...obj,
|
|
226
|
+
...obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING }
|
|
227
|
+
}), "GetRoleCredentialsRequestFilterSensitiveLog");
|
|
228
|
+
var RoleCredentialsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
229
|
+
...obj,
|
|
230
|
+
...obj.secretAccessKey && { secretAccessKey: import_smithy_client.SENSITIVE_STRING },
|
|
231
|
+
...obj.sessionToken && { sessionToken: import_smithy_client.SENSITIVE_STRING }
|
|
232
|
+
}), "RoleCredentialsFilterSensitiveLog");
|
|
233
|
+
var GetRoleCredentialsResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
234
|
+
...obj,
|
|
235
|
+
...obj.roleCredentials && { roleCredentials: RoleCredentialsFilterSensitiveLog(obj.roleCredentials) }
|
|
236
|
+
}), "GetRoleCredentialsResponseFilterSensitiveLog");
|
|
237
|
+
var ListAccountRolesRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
238
|
+
...obj,
|
|
239
|
+
...obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING }
|
|
240
|
+
}), "ListAccountRolesRequestFilterSensitiveLog");
|
|
241
|
+
var ListAccountsRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
242
|
+
...obj,
|
|
243
|
+
...obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING }
|
|
244
|
+
}), "ListAccountsRequestFilterSensitiveLog");
|
|
245
|
+
var LogoutRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
246
|
+
...obj,
|
|
247
|
+
...obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING }
|
|
248
|
+
}), "LogoutRequestFilterSensitiveLog");
|
|
249
|
+
|
|
250
|
+
// src/protocols/Aws_restJson1.ts
|
|
251
|
+
var import_core = require("@smithy/core");
|
|
252
|
+
|
|
253
|
+
var se_GetRoleCredentialsCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
254
|
+
const b = (0, import_core.requestBuilder)(input, context);
|
|
255
|
+
const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
|
|
256
|
+
[_xasbt]: input[_aT]
|
|
257
|
+
});
|
|
258
|
+
b.bp("/federation/credentials");
|
|
259
|
+
const query = (0, import_smithy_client.map)({
|
|
260
|
+
[_rn]: [, (0, import_smithy_client.expectNonNull)(input[_rN], `roleName`)],
|
|
261
|
+
[_ai]: [, (0, import_smithy_client.expectNonNull)(input[_aI], `accountId`)]
|
|
262
|
+
});
|
|
263
|
+
let body;
|
|
264
|
+
b.m("GET").h(headers).q(query).b(body);
|
|
265
|
+
return b.build();
|
|
266
|
+
}, "se_GetRoleCredentialsCommand");
|
|
267
|
+
var se_ListAccountRolesCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
268
|
+
const b = (0, import_core.requestBuilder)(input, context);
|
|
269
|
+
const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
|
|
270
|
+
[_xasbt]: input[_aT]
|
|
271
|
+
});
|
|
272
|
+
b.bp("/assignment/roles");
|
|
273
|
+
const query = (0, import_smithy_client.map)({
|
|
274
|
+
[_nt]: [, input[_nT]],
|
|
275
|
+
[_mr]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
|
|
276
|
+
[_ai]: [, (0, import_smithy_client.expectNonNull)(input[_aI], `accountId`)]
|
|
277
|
+
});
|
|
278
|
+
let body;
|
|
279
|
+
b.m("GET").h(headers).q(query).b(body);
|
|
280
|
+
return b.build();
|
|
281
|
+
}, "se_ListAccountRolesCommand");
|
|
282
|
+
var se_ListAccountsCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
283
|
+
const b = (0, import_core.requestBuilder)(input, context);
|
|
284
|
+
const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
|
|
285
|
+
[_xasbt]: input[_aT]
|
|
286
|
+
});
|
|
287
|
+
b.bp("/assignment/accounts");
|
|
288
|
+
const query = (0, import_smithy_client.map)({
|
|
289
|
+
[_nt]: [, input[_nT]],
|
|
290
|
+
[_mr]: [() => input.maxResults !== void 0, () => input[_mR].toString()]
|
|
291
|
+
});
|
|
292
|
+
let body;
|
|
293
|
+
b.m("GET").h(headers).q(query).b(body);
|
|
294
|
+
return b.build();
|
|
295
|
+
}, "se_ListAccountsCommand");
|
|
296
|
+
var se_LogoutCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
297
|
+
const b = (0, import_core.requestBuilder)(input, context);
|
|
298
|
+
const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
|
|
299
|
+
[_xasbt]: input[_aT]
|
|
300
|
+
});
|
|
301
|
+
b.bp("/logout");
|
|
302
|
+
let body;
|
|
303
|
+
b.m("POST").h(headers).b(body);
|
|
304
|
+
return b.build();
|
|
305
|
+
}, "se_LogoutCommand");
|
|
306
|
+
var de_GetRoleCredentialsCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
307
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
308
|
+
return de_GetRoleCredentialsCommandError(output, context);
|
|
309
|
+
}
|
|
310
|
+
const contents = (0, import_smithy_client.map)({
|
|
311
|
+
$metadata: deserializeMetadata(output)
|
|
312
|
+
});
|
|
313
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
|
|
314
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
315
|
+
roleCredentials: import_smithy_client._json
|
|
316
|
+
});
|
|
317
|
+
Object.assign(contents, doc);
|
|
318
|
+
return contents;
|
|
319
|
+
}, "de_GetRoleCredentialsCommand");
|
|
320
|
+
var de_GetRoleCredentialsCommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
321
|
+
const parsedOutput = {
|
|
322
|
+
...output,
|
|
323
|
+
body: await parseErrorBody(output.body, context)
|
|
324
|
+
};
|
|
325
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
326
|
+
switch (errorCode) {
|
|
327
|
+
case "InvalidRequestException":
|
|
328
|
+
case "com.amazonaws.sso#InvalidRequestException":
|
|
329
|
+
throw await de_InvalidRequestExceptionRes(parsedOutput, context);
|
|
330
|
+
case "ResourceNotFoundException":
|
|
331
|
+
case "com.amazonaws.sso#ResourceNotFoundException":
|
|
332
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
333
|
+
case "TooManyRequestsException":
|
|
334
|
+
case "com.amazonaws.sso#TooManyRequestsException":
|
|
335
|
+
throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
|
|
336
|
+
case "UnauthorizedException":
|
|
337
|
+
case "com.amazonaws.sso#UnauthorizedException":
|
|
338
|
+
throw await de_UnauthorizedExceptionRes(parsedOutput, context);
|
|
339
|
+
default:
|
|
340
|
+
const parsedBody = parsedOutput.body;
|
|
341
|
+
return throwDefaultError({
|
|
342
|
+
output,
|
|
343
|
+
parsedBody,
|
|
344
|
+
errorCode
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
}, "de_GetRoleCredentialsCommandError");
|
|
348
|
+
var de_ListAccountRolesCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
349
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
350
|
+
return de_ListAccountRolesCommandError(output, context);
|
|
351
|
+
}
|
|
352
|
+
const contents = (0, import_smithy_client.map)({
|
|
353
|
+
$metadata: deserializeMetadata(output)
|
|
354
|
+
});
|
|
355
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
|
|
356
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
357
|
+
nextToken: import_smithy_client.expectString,
|
|
358
|
+
roleList: import_smithy_client._json
|
|
359
|
+
});
|
|
360
|
+
Object.assign(contents, doc);
|
|
361
|
+
return contents;
|
|
362
|
+
}, "de_ListAccountRolesCommand");
|
|
363
|
+
var de_ListAccountRolesCommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
364
|
+
const parsedOutput = {
|
|
365
|
+
...output,
|
|
366
|
+
body: await parseErrorBody(output.body, context)
|
|
367
|
+
};
|
|
368
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
369
|
+
switch (errorCode) {
|
|
370
|
+
case "InvalidRequestException":
|
|
371
|
+
case "com.amazonaws.sso#InvalidRequestException":
|
|
372
|
+
throw await de_InvalidRequestExceptionRes(parsedOutput, context);
|
|
373
|
+
case "ResourceNotFoundException":
|
|
374
|
+
case "com.amazonaws.sso#ResourceNotFoundException":
|
|
375
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
376
|
+
case "TooManyRequestsException":
|
|
377
|
+
case "com.amazonaws.sso#TooManyRequestsException":
|
|
378
|
+
throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
|
|
379
|
+
case "UnauthorizedException":
|
|
380
|
+
case "com.amazonaws.sso#UnauthorizedException":
|
|
381
|
+
throw await de_UnauthorizedExceptionRes(parsedOutput, context);
|
|
382
|
+
default:
|
|
383
|
+
const parsedBody = parsedOutput.body;
|
|
384
|
+
return throwDefaultError({
|
|
385
|
+
output,
|
|
386
|
+
parsedBody,
|
|
387
|
+
errorCode
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
}, "de_ListAccountRolesCommandError");
|
|
391
|
+
var de_ListAccountsCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
392
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
393
|
+
return de_ListAccountsCommandError(output, context);
|
|
394
|
+
}
|
|
395
|
+
const contents = (0, import_smithy_client.map)({
|
|
396
|
+
$metadata: deserializeMetadata(output)
|
|
397
|
+
});
|
|
398
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
|
|
399
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
400
|
+
accountList: import_smithy_client._json,
|
|
401
|
+
nextToken: import_smithy_client.expectString
|
|
402
|
+
});
|
|
403
|
+
Object.assign(contents, doc);
|
|
404
|
+
return contents;
|
|
405
|
+
}, "de_ListAccountsCommand");
|
|
406
|
+
var de_ListAccountsCommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
407
|
+
const parsedOutput = {
|
|
408
|
+
...output,
|
|
409
|
+
body: await parseErrorBody(output.body, context)
|
|
410
|
+
};
|
|
411
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
412
|
+
switch (errorCode) {
|
|
413
|
+
case "InvalidRequestException":
|
|
414
|
+
case "com.amazonaws.sso#InvalidRequestException":
|
|
415
|
+
throw await de_InvalidRequestExceptionRes(parsedOutput, context);
|
|
416
|
+
case "ResourceNotFoundException":
|
|
417
|
+
case "com.amazonaws.sso#ResourceNotFoundException":
|
|
418
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
419
|
+
case "TooManyRequestsException":
|
|
420
|
+
case "com.amazonaws.sso#TooManyRequestsException":
|
|
421
|
+
throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
|
|
422
|
+
case "UnauthorizedException":
|
|
423
|
+
case "com.amazonaws.sso#UnauthorizedException":
|
|
424
|
+
throw await de_UnauthorizedExceptionRes(parsedOutput, context);
|
|
425
|
+
default:
|
|
426
|
+
const parsedBody = parsedOutput.body;
|
|
427
|
+
return throwDefaultError({
|
|
428
|
+
output,
|
|
429
|
+
parsedBody,
|
|
430
|
+
errorCode
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
}, "de_ListAccountsCommandError");
|
|
434
|
+
var de_LogoutCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
435
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
436
|
+
return de_LogoutCommandError(output, context);
|
|
437
|
+
}
|
|
438
|
+
const contents = (0, import_smithy_client.map)({
|
|
439
|
+
$metadata: deserializeMetadata(output)
|
|
440
|
+
});
|
|
441
|
+
await (0, import_smithy_client.collectBody)(output.body, context);
|
|
442
|
+
return contents;
|
|
443
|
+
}, "de_LogoutCommand");
|
|
444
|
+
var de_LogoutCommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
445
|
+
const parsedOutput = {
|
|
446
|
+
...output,
|
|
447
|
+
body: await parseErrorBody(output.body, context)
|
|
448
|
+
};
|
|
449
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
450
|
+
switch (errorCode) {
|
|
451
|
+
case "InvalidRequestException":
|
|
452
|
+
case "com.amazonaws.sso#InvalidRequestException":
|
|
453
|
+
throw await de_InvalidRequestExceptionRes(parsedOutput, context);
|
|
454
|
+
case "TooManyRequestsException":
|
|
455
|
+
case "com.amazonaws.sso#TooManyRequestsException":
|
|
456
|
+
throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
|
|
457
|
+
case "UnauthorizedException":
|
|
458
|
+
case "com.amazonaws.sso#UnauthorizedException":
|
|
459
|
+
throw await de_UnauthorizedExceptionRes(parsedOutput, context);
|
|
460
|
+
default:
|
|
461
|
+
const parsedBody = parsedOutput.body;
|
|
462
|
+
return throwDefaultError({
|
|
463
|
+
output,
|
|
464
|
+
parsedBody,
|
|
465
|
+
errorCode
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
}, "de_LogoutCommandError");
|
|
469
|
+
var throwDefaultError = (0, import_smithy_client.withBaseException)(SSOServiceException);
|
|
470
|
+
var de_InvalidRequestExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
471
|
+
const contents = (0, import_smithy_client.map)({});
|
|
472
|
+
const data = parsedOutput.body;
|
|
473
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
474
|
+
message: import_smithy_client.expectString
|
|
475
|
+
});
|
|
476
|
+
Object.assign(contents, doc);
|
|
477
|
+
const exception = new InvalidRequestException({
|
|
478
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
479
|
+
...contents
|
|
480
|
+
});
|
|
481
|
+
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
482
|
+
}, "de_InvalidRequestExceptionRes");
|
|
483
|
+
var de_ResourceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
484
|
+
const contents = (0, import_smithy_client.map)({});
|
|
485
|
+
const data = parsedOutput.body;
|
|
486
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
487
|
+
message: import_smithy_client.expectString
|
|
488
|
+
});
|
|
489
|
+
Object.assign(contents, doc);
|
|
490
|
+
const exception = new ResourceNotFoundException({
|
|
491
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
492
|
+
...contents
|
|
493
|
+
});
|
|
494
|
+
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
495
|
+
}, "de_ResourceNotFoundExceptionRes");
|
|
496
|
+
var de_TooManyRequestsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
497
|
+
const contents = (0, import_smithy_client.map)({});
|
|
498
|
+
const data = parsedOutput.body;
|
|
499
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
500
|
+
message: import_smithy_client.expectString
|
|
501
|
+
});
|
|
502
|
+
Object.assign(contents, doc);
|
|
503
|
+
const exception = new TooManyRequestsException({
|
|
504
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
505
|
+
...contents
|
|
506
|
+
});
|
|
507
|
+
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
508
|
+
}, "de_TooManyRequestsExceptionRes");
|
|
509
|
+
var de_UnauthorizedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
510
|
+
const contents = (0, import_smithy_client.map)({});
|
|
511
|
+
const data = parsedOutput.body;
|
|
512
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
513
|
+
message: import_smithy_client.expectString
|
|
514
|
+
});
|
|
515
|
+
Object.assign(contents, doc);
|
|
516
|
+
const exception = new UnauthorizedException({
|
|
517
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
518
|
+
...contents
|
|
519
|
+
});
|
|
520
|
+
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
521
|
+
}, "de_UnauthorizedExceptionRes");
|
|
522
|
+
var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
|
|
523
|
+
httpStatusCode: output.statusCode,
|
|
524
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
525
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
526
|
+
cfId: output.headers["x-amz-cf-id"]
|
|
527
|
+
}), "deserializeMetadata");
|
|
528
|
+
var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
|
|
529
|
+
var isSerializableHeaderValue = /* @__PURE__ */ __name((value) => value !== void 0 && value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0), "isSerializableHeaderValue");
|
|
530
|
+
var _aI = "accountId";
|
|
531
|
+
var _aT = "accessToken";
|
|
532
|
+
var _ai = "account_id";
|
|
533
|
+
var _mR = "maxResults";
|
|
534
|
+
var _mr = "max_result";
|
|
535
|
+
var _nT = "nextToken";
|
|
536
|
+
var _nt = "next_token";
|
|
537
|
+
var _rN = "roleName";
|
|
538
|
+
var _rn = "role_name";
|
|
539
|
+
var _xasbt = "x-amz-sso_bearer_token";
|
|
540
|
+
var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
541
|
+
if (encoded.length) {
|
|
542
|
+
return JSON.parse(encoded);
|
|
543
|
+
}
|
|
544
|
+
return {};
|
|
545
|
+
}), "parseBody");
|
|
546
|
+
var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
|
|
547
|
+
const value = await parseBody(errorBody, context);
|
|
548
|
+
value.message = value.message ?? value.Message;
|
|
549
|
+
return value;
|
|
550
|
+
}, "parseErrorBody");
|
|
551
|
+
var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
|
|
552
|
+
const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
|
|
553
|
+
const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
|
|
554
|
+
let cleanValue = rawValue;
|
|
555
|
+
if (typeof cleanValue === "number") {
|
|
556
|
+
cleanValue = cleanValue.toString();
|
|
557
|
+
}
|
|
558
|
+
if (cleanValue.indexOf(",") >= 0) {
|
|
559
|
+
cleanValue = cleanValue.split(",")[0];
|
|
560
|
+
}
|
|
561
|
+
if (cleanValue.indexOf(":") >= 0) {
|
|
562
|
+
cleanValue = cleanValue.split(":")[0];
|
|
563
|
+
}
|
|
564
|
+
if (cleanValue.indexOf("#") >= 0) {
|
|
565
|
+
cleanValue = cleanValue.split("#")[1];
|
|
566
|
+
}
|
|
567
|
+
return cleanValue;
|
|
568
|
+
}, "sanitizeErrorCode");
|
|
569
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
570
|
+
if (headerKey !== void 0) {
|
|
571
|
+
return sanitizeErrorCode(output.headers[headerKey]);
|
|
572
|
+
}
|
|
573
|
+
if (data.code !== void 0) {
|
|
574
|
+
return sanitizeErrorCode(data.code);
|
|
575
|
+
}
|
|
576
|
+
if (data["__type"] !== void 0) {
|
|
577
|
+
return sanitizeErrorCode(data["__type"]);
|
|
578
|
+
}
|
|
579
|
+
}, "loadRestJsonErrorCode");
|
|
580
|
+
|
|
581
|
+
// src/commands/GetRoleCredentialsCommand.ts
|
|
582
|
+
var _GetRoleCredentialsCommand = class _GetRoleCredentialsCommand extends import_smithy_client.Command.classBuilder().ep({
|
|
583
|
+
...commonParams
|
|
584
|
+
}).m(function(Command, cs, config, o) {
|
|
585
|
+
return [
|
|
586
|
+
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
587
|
+
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
|
|
588
|
+
];
|
|
589
|
+
}).s("SWBPortalService", "GetRoleCredentials", {}).n("SSOClient", "GetRoleCredentialsCommand").f(GetRoleCredentialsRequestFilterSensitiveLog, GetRoleCredentialsResponseFilterSensitiveLog).ser(se_GetRoleCredentialsCommand).de(de_GetRoleCredentialsCommand).build() {
|
|
590
|
+
};
|
|
591
|
+
__name(_GetRoleCredentialsCommand, "GetRoleCredentialsCommand");
|
|
592
|
+
var GetRoleCredentialsCommand = _GetRoleCredentialsCommand;
|
|
593
|
+
|
|
594
|
+
// src/commands/ListAccountRolesCommand.ts
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
var _ListAccountRolesCommand = class _ListAccountRolesCommand extends import_smithy_client.Command.classBuilder().ep({
|
|
600
|
+
...commonParams
|
|
601
|
+
}).m(function(Command, cs, config, o) {
|
|
602
|
+
return [
|
|
603
|
+
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
604
|
+
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
|
|
605
|
+
];
|
|
606
|
+
}).s("SWBPortalService", "ListAccountRoles", {}).n("SSOClient", "ListAccountRolesCommand").f(ListAccountRolesRequestFilterSensitiveLog, void 0).ser(se_ListAccountRolesCommand).de(de_ListAccountRolesCommand).build() {
|
|
607
|
+
};
|
|
608
|
+
__name(_ListAccountRolesCommand, "ListAccountRolesCommand");
|
|
609
|
+
var ListAccountRolesCommand = _ListAccountRolesCommand;
|
|
610
|
+
|
|
611
|
+
// src/commands/ListAccountsCommand.ts
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
var _ListAccountsCommand = class _ListAccountsCommand extends import_smithy_client.Command.classBuilder().ep({
|
|
617
|
+
...commonParams
|
|
618
|
+
}).m(function(Command, cs, config, o) {
|
|
619
|
+
return [
|
|
620
|
+
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
621
|
+
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
|
|
622
|
+
];
|
|
623
|
+
}).s("SWBPortalService", "ListAccounts", {}).n("SSOClient", "ListAccountsCommand").f(ListAccountsRequestFilterSensitiveLog, void 0).ser(se_ListAccountsCommand).de(de_ListAccountsCommand).build() {
|
|
624
|
+
};
|
|
625
|
+
__name(_ListAccountsCommand, "ListAccountsCommand");
|
|
626
|
+
var ListAccountsCommand = _ListAccountsCommand;
|
|
627
|
+
|
|
628
|
+
// src/commands/LogoutCommand.ts
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
var _LogoutCommand = class _LogoutCommand extends import_smithy_client.Command.classBuilder().ep({
|
|
634
|
+
...commonParams
|
|
635
|
+
}).m(function(Command, cs, config, o) {
|
|
636
|
+
return [
|
|
637
|
+
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
638
|
+
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
|
|
639
|
+
];
|
|
640
|
+
}).s("SWBPortalService", "Logout", {}).n("SSOClient", "LogoutCommand").f(LogoutRequestFilterSensitiveLog, void 0).ser(se_LogoutCommand).de(de_LogoutCommand).build() {
|
|
641
|
+
};
|
|
642
|
+
__name(_LogoutCommand, "LogoutCommand");
|
|
643
|
+
var LogoutCommand = _LogoutCommand;
|
|
644
|
+
|
|
645
|
+
// src/SSO.ts
|
|
646
|
+
var commands = {
|
|
647
|
+
GetRoleCredentialsCommand,
|
|
648
|
+
ListAccountRolesCommand,
|
|
649
|
+
ListAccountsCommand,
|
|
650
|
+
LogoutCommand
|
|
651
|
+
};
|
|
652
|
+
var _SSO = class _SSO extends SSOClient {
|
|
653
|
+
};
|
|
654
|
+
__name(_SSO, "SSO");
|
|
655
|
+
var SSO = _SSO;
|
|
656
|
+
(0, import_smithy_client.createAggregatedClient)(commands, SSO);
|
|
657
|
+
|
|
658
|
+
// src/pagination/ListAccountRolesPaginator.ts
|
|
659
|
+
|
|
660
|
+
var paginateListAccountRoles = (0, import_core.createPaginator)(SSOClient, ListAccountRolesCommand, "nextToken", "nextToken", "maxResults");
|
|
661
|
+
|
|
662
|
+
// src/pagination/ListAccountsPaginator.ts
|
|
663
|
+
|
|
664
|
+
var paginateListAccounts = (0, import_core.createPaginator)(SSOClient, ListAccountsCommand, "nextToken", "nextToken", "maxResults");
|
|
665
|
+
|
|
666
|
+
// src/index.ts
|
|
667
|
+
var import_util_endpoints = require("@aws-sdk/util-endpoints");
|
|
668
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
669
|
+
0 && (module.exports = {
|
|
670
|
+
GetRoleCredentialsCommand,
|
|
671
|
+
GetRoleCredentialsRequestFilterSensitiveLog,
|
|
672
|
+
GetRoleCredentialsResponseFilterSensitiveLog,
|
|
673
|
+
InvalidRequestException,
|
|
674
|
+
ListAccountRolesCommand,
|
|
675
|
+
ListAccountRolesRequestFilterSensitiveLog,
|
|
676
|
+
ListAccountsCommand,
|
|
677
|
+
ListAccountsRequestFilterSensitiveLog,
|
|
678
|
+
LogoutCommand,
|
|
679
|
+
LogoutRequestFilterSensitiveLog,
|
|
680
|
+
ResourceNotFoundException,
|
|
681
|
+
RoleCredentialsFilterSensitiveLog,
|
|
682
|
+
SSO,
|
|
683
|
+
SSOClient,
|
|
684
|
+
SSOServiceException,
|
|
685
|
+
TooManyRequestsException,
|
|
686
|
+
UnauthorizedException,
|
|
687
|
+
__Client,
|
|
688
|
+
paginateListAccountRoles,
|
|
689
|
+
paginateListAccounts
|
|
690
|
+
});
|