@aws-sdk/client-sso-oidc 3.525.0 → 3.529.1
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/index.js +7 -47
- package/dist-es/protocols/Aws_restJson1.js +1 -40
- package/package.json +4 -4
package/dist-cjs/index.js
CHANGED
|
@@ -503,6 +503,7 @@ var StartDeviceAuthorizationRequestFilterSensitiveLog = /* @__PURE__ */ __name((
|
|
|
503
503
|
}), "StartDeviceAuthorizationRequestFilterSensitiveLog");
|
|
504
504
|
|
|
505
505
|
// src/protocols/Aws_restJson1.ts
|
|
506
|
+
var import_core2 = require("@aws-sdk/core");
|
|
506
507
|
|
|
507
508
|
|
|
508
509
|
var se_CreateTokenCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
@@ -595,7 +596,7 @@ var de_CreateTokenCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
|
595
596
|
const contents = (0, import_smithy_client.map)({
|
|
596
597
|
$metadata: deserializeMetadata(output)
|
|
597
598
|
});
|
|
598
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
599
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
599
600
|
const doc = (0, import_smithy_client.take)(data, {
|
|
600
601
|
accessToken: import_smithy_client.expectString,
|
|
601
602
|
expiresIn: import_smithy_client.expectInt32,
|
|
@@ -613,7 +614,7 @@ var de_CreateTokenWithIAMCommand = /* @__PURE__ */ __name(async (output, context
|
|
|
613
614
|
const contents = (0, import_smithy_client.map)({
|
|
614
615
|
$metadata: deserializeMetadata(output)
|
|
615
616
|
});
|
|
616
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
617
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
617
618
|
const doc = (0, import_smithy_client.take)(data, {
|
|
618
619
|
accessToken: import_smithy_client.expectString,
|
|
619
620
|
expiresIn: import_smithy_client.expectInt32,
|
|
@@ -633,7 +634,7 @@ var de_RegisterClientCommand = /* @__PURE__ */ __name(async (output, context) =>
|
|
|
633
634
|
const contents = (0, import_smithy_client.map)({
|
|
634
635
|
$metadata: deserializeMetadata(output)
|
|
635
636
|
});
|
|
636
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
637
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
637
638
|
const doc = (0, import_smithy_client.take)(data, {
|
|
638
639
|
authorizationEndpoint: import_smithy_client.expectString,
|
|
639
640
|
clientId: import_smithy_client.expectString,
|
|
@@ -652,7 +653,7 @@ var de_StartDeviceAuthorizationCommand = /* @__PURE__ */ __name(async (output, c
|
|
|
652
653
|
const contents = (0, import_smithy_client.map)({
|
|
653
654
|
$metadata: deserializeMetadata(output)
|
|
654
655
|
});
|
|
655
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
656
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
656
657
|
const doc = (0, import_smithy_client.take)(data, {
|
|
657
658
|
deviceCode: import_smithy_client.expectString,
|
|
658
659
|
expiresIn: import_smithy_client.expectInt32,
|
|
@@ -667,9 +668,9 @@ var de_StartDeviceAuthorizationCommand = /* @__PURE__ */ __name(async (output, c
|
|
|
667
668
|
var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
668
669
|
const parsedOutput = {
|
|
669
670
|
...output,
|
|
670
|
-
body: await
|
|
671
|
+
body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
|
|
671
672
|
};
|
|
672
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
673
|
+
const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
|
|
673
674
|
switch (errorCode) {
|
|
674
675
|
case "AccessDeniedException":
|
|
675
676
|
case "com.amazonaws.ssooidc#AccessDeniedException":
|
|
@@ -910,48 +911,7 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
|
|
|
910
911
|
extendedRequestId: output.headers["x-amz-id-2"],
|
|
911
912
|
cfId: output.headers["x-amz-cf-id"]
|
|
912
913
|
}), "deserializeMetadata");
|
|
913
|
-
var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
|
|
914
914
|
var _ai = "aws_iam";
|
|
915
|
-
var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
916
|
-
if (encoded.length) {
|
|
917
|
-
return JSON.parse(encoded);
|
|
918
|
-
}
|
|
919
|
-
return {};
|
|
920
|
-
}), "parseBody");
|
|
921
|
-
var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
|
|
922
|
-
const value = await parseBody(errorBody, context);
|
|
923
|
-
value.message = value.message ?? value.Message;
|
|
924
|
-
return value;
|
|
925
|
-
}, "parseErrorBody");
|
|
926
|
-
var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
|
|
927
|
-
const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
|
|
928
|
-
const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
|
|
929
|
-
let cleanValue = rawValue;
|
|
930
|
-
if (typeof cleanValue === "number") {
|
|
931
|
-
cleanValue = cleanValue.toString();
|
|
932
|
-
}
|
|
933
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
934
|
-
cleanValue = cleanValue.split(",")[0];
|
|
935
|
-
}
|
|
936
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
937
|
-
cleanValue = cleanValue.split(":")[0];
|
|
938
|
-
}
|
|
939
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
940
|
-
cleanValue = cleanValue.split("#")[1];
|
|
941
|
-
}
|
|
942
|
-
return cleanValue;
|
|
943
|
-
}, "sanitizeErrorCode");
|
|
944
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
945
|
-
if (headerKey !== void 0) {
|
|
946
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
947
|
-
}
|
|
948
|
-
if (data.code !== void 0) {
|
|
949
|
-
return sanitizeErrorCode(data.code);
|
|
950
|
-
}
|
|
951
|
-
if (data["__type"] !== void 0) {
|
|
952
|
-
return sanitizeErrorCode(data["__type"]);
|
|
953
|
-
}
|
|
954
|
-
}, "loadRestJsonErrorCode");
|
|
955
915
|
|
|
956
916
|
// src/commands/CreateTokenCommand.ts
|
|
957
917
|
var _CreateTokenCommand = class _CreateTokenCommand extends import_smithy_client.Command.classBuilder().ep({
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
|
|
1
2
|
import { requestBuilder as rb } from "@smithy/core";
|
|
2
3
|
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map, take, withBaseException, } from "@smithy/smithy-client";
|
|
3
4
|
import { AccessDeniedException, AuthorizationPendingException, ExpiredTokenException, InternalServerException, InvalidClientException, InvalidClientMetadataException, InvalidGrantException, InvalidRequestException, InvalidRequestRegionException, InvalidScopeException, SlowDownException, UnauthorizedClientException, UnsupportedGrantTypeException, } from "../models/models_0";
|
|
@@ -406,43 +407,3 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
|
406
407
|
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
407
408
|
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
408
409
|
const _ai = "aws_iam";
|
|
409
|
-
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
410
|
-
if (encoded.length) {
|
|
411
|
-
return JSON.parse(encoded);
|
|
412
|
-
}
|
|
413
|
-
return {};
|
|
414
|
-
});
|
|
415
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
416
|
-
const value = await parseBody(errorBody, context);
|
|
417
|
-
value.message = value.message ?? value.Message;
|
|
418
|
-
return value;
|
|
419
|
-
};
|
|
420
|
-
const loadRestJsonErrorCode = (output, data) => {
|
|
421
|
-
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
422
|
-
const sanitizeErrorCode = (rawValue) => {
|
|
423
|
-
let cleanValue = rawValue;
|
|
424
|
-
if (typeof cleanValue === "number") {
|
|
425
|
-
cleanValue = cleanValue.toString();
|
|
426
|
-
}
|
|
427
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
428
|
-
cleanValue = cleanValue.split(",")[0];
|
|
429
|
-
}
|
|
430
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
431
|
-
cleanValue = cleanValue.split(":")[0];
|
|
432
|
-
}
|
|
433
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
434
|
-
cleanValue = cleanValue.split("#")[1];
|
|
435
|
-
}
|
|
436
|
-
return cleanValue;
|
|
437
|
-
};
|
|
438
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
439
|
-
if (headerKey !== undefined) {
|
|
440
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
441
|
-
}
|
|
442
|
-
if (data.code !== undefined) {
|
|
443
|
-
return sanitizeErrorCode(data.code);
|
|
444
|
-
}
|
|
445
|
-
if (data["__type"] !== undefined) {
|
|
446
|
-
return sanitizeErrorCode(data["__type"]);
|
|
447
|
-
}
|
|
448
|
-
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-sso-oidc",
|
|
3
3
|
"description": "AWS SDK for JavaScript Sso Oidc Client for Node.js, Browser and React Native",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.529.1",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
7
7
|
"build:cjs": "node ../../scripts/compilation/inline client-sso-oidc",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@aws-crypto/sha256-browser": "3.0.0",
|
|
22
22
|
"@aws-crypto/sha256-js": "3.0.0",
|
|
23
|
-
"@aws-sdk/client-sts": "3.
|
|
24
|
-
"@aws-sdk/core": "3.
|
|
23
|
+
"@aws-sdk/client-sts": "3.529.1",
|
|
24
|
+
"@aws-sdk/core": "3.529.1",
|
|
25
25
|
"@aws-sdk/middleware-host-header": "3.523.0",
|
|
26
26
|
"@aws-sdk/middleware-logger": "3.523.0",
|
|
27
27
|
"@aws-sdk/middleware-recursion-detection": "3.523.0",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
},
|
|
87
87
|
"license": "Apache-2.0",
|
|
88
88
|
"peerDependencies": {
|
|
89
|
-
"@aws-sdk/credential-provider-node": "^3.
|
|
89
|
+
"@aws-sdk/credential-provider-node": "^3.529.1"
|
|
90
90
|
},
|
|
91
91
|
"browser": {
|
|
92
92
|
"./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser"
|