@aws-sdk/client-cognito-identity 3.525.0 → 3.529.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/index.js +22 -62
- package/dist-es/protocols/Aws_json1_1.js +1 -40
- package/package.json +5 -5
package/dist-cjs/index.js
CHANGED
|
@@ -220,6 +220,7 @@ var import_middleware_serde = require("@smithy/middleware-serde");
|
|
|
220
220
|
var import_types = require("@smithy/types");
|
|
221
221
|
|
|
222
222
|
// src/protocols/Aws_json1_1.ts
|
|
223
|
+
var import_core2 = require("@aws-sdk/core");
|
|
223
224
|
|
|
224
225
|
|
|
225
226
|
|
|
@@ -587,7 +588,7 @@ var de_CreateIdentityPoolCommand = /* @__PURE__ */ __name(async (output, context
|
|
|
587
588
|
if (output.statusCode >= 300) {
|
|
588
589
|
return de_CommandError(output, context);
|
|
589
590
|
}
|
|
590
|
-
const data = await
|
|
591
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
591
592
|
let contents = {};
|
|
592
593
|
contents = (0, import_smithy_client._json)(data);
|
|
593
594
|
const response = {
|
|
@@ -600,7 +601,7 @@ var de_DeleteIdentitiesCommand = /* @__PURE__ */ __name(async (output, context)
|
|
|
600
601
|
if (output.statusCode >= 300) {
|
|
601
602
|
return de_CommandError(output, context);
|
|
602
603
|
}
|
|
603
|
-
const data = await
|
|
604
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
604
605
|
let contents = {};
|
|
605
606
|
contents = (0, import_smithy_client._json)(data);
|
|
606
607
|
const response = {
|
|
@@ -623,7 +624,7 @@ var de_DescribeIdentityCommand = /* @__PURE__ */ __name(async (output, context)
|
|
|
623
624
|
if (output.statusCode >= 300) {
|
|
624
625
|
return de_CommandError(output, context);
|
|
625
626
|
}
|
|
626
|
-
const data = await
|
|
627
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
627
628
|
let contents = {};
|
|
628
629
|
contents = de_IdentityDescription(data, context);
|
|
629
630
|
const response = {
|
|
@@ -636,7 +637,7 @@ var de_DescribeIdentityPoolCommand = /* @__PURE__ */ __name(async (output, conte
|
|
|
636
637
|
if (output.statusCode >= 300) {
|
|
637
638
|
return de_CommandError(output, context);
|
|
638
639
|
}
|
|
639
|
-
const data = await
|
|
640
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
640
641
|
let contents = {};
|
|
641
642
|
contents = (0, import_smithy_client._json)(data);
|
|
642
643
|
const response = {
|
|
@@ -649,7 +650,7 @@ var de_GetCredentialsForIdentityCommand = /* @__PURE__ */ __name(async (output,
|
|
|
649
650
|
if (output.statusCode >= 300) {
|
|
650
651
|
return de_CommandError(output, context);
|
|
651
652
|
}
|
|
652
|
-
const data = await
|
|
653
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
653
654
|
let contents = {};
|
|
654
655
|
contents = de_GetCredentialsForIdentityResponse(data, context);
|
|
655
656
|
const response = {
|
|
@@ -662,7 +663,7 @@ var de_GetIdCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
|
662
663
|
if (output.statusCode >= 300) {
|
|
663
664
|
return de_CommandError(output, context);
|
|
664
665
|
}
|
|
665
|
-
const data = await
|
|
666
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
666
667
|
let contents = {};
|
|
667
668
|
contents = (0, import_smithy_client._json)(data);
|
|
668
669
|
const response = {
|
|
@@ -675,7 +676,7 @@ var de_GetIdentityPoolRolesCommand = /* @__PURE__ */ __name(async (output, conte
|
|
|
675
676
|
if (output.statusCode >= 300) {
|
|
676
677
|
return de_CommandError(output, context);
|
|
677
678
|
}
|
|
678
|
-
const data = await
|
|
679
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
679
680
|
let contents = {};
|
|
680
681
|
contents = (0, import_smithy_client._json)(data);
|
|
681
682
|
const response = {
|
|
@@ -688,7 +689,7 @@ var de_GetOpenIdTokenCommand = /* @__PURE__ */ __name(async (output, context) =>
|
|
|
688
689
|
if (output.statusCode >= 300) {
|
|
689
690
|
return de_CommandError(output, context);
|
|
690
691
|
}
|
|
691
|
-
const data = await
|
|
692
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
692
693
|
let contents = {};
|
|
693
694
|
contents = (0, import_smithy_client._json)(data);
|
|
694
695
|
const response = {
|
|
@@ -701,7 +702,7 @@ var de_GetOpenIdTokenForDeveloperIdentityCommand = /* @__PURE__ */ __name(async
|
|
|
701
702
|
if (output.statusCode >= 300) {
|
|
702
703
|
return de_CommandError(output, context);
|
|
703
704
|
}
|
|
704
|
-
const data = await
|
|
705
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
705
706
|
let contents = {};
|
|
706
707
|
contents = (0, import_smithy_client._json)(data);
|
|
707
708
|
const response = {
|
|
@@ -714,7 +715,7 @@ var de_GetPrincipalTagAttributeMapCommand = /* @__PURE__ */ __name(async (output
|
|
|
714
715
|
if (output.statusCode >= 300) {
|
|
715
716
|
return de_CommandError(output, context);
|
|
716
717
|
}
|
|
717
|
-
const data = await
|
|
718
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
718
719
|
let contents = {};
|
|
719
720
|
contents = (0, import_smithy_client._json)(data);
|
|
720
721
|
const response = {
|
|
@@ -727,7 +728,7 @@ var de_ListIdentitiesCommand = /* @__PURE__ */ __name(async (output, context) =>
|
|
|
727
728
|
if (output.statusCode >= 300) {
|
|
728
729
|
return de_CommandError(output, context);
|
|
729
730
|
}
|
|
730
|
-
const data = await
|
|
731
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
731
732
|
let contents = {};
|
|
732
733
|
contents = de_ListIdentitiesResponse(data, context);
|
|
733
734
|
const response = {
|
|
@@ -740,7 +741,7 @@ var de_ListIdentityPoolsCommand = /* @__PURE__ */ __name(async (output, context)
|
|
|
740
741
|
if (output.statusCode >= 300) {
|
|
741
742
|
return de_CommandError(output, context);
|
|
742
743
|
}
|
|
743
|
-
const data = await
|
|
744
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
744
745
|
let contents = {};
|
|
745
746
|
contents = (0, import_smithy_client._json)(data);
|
|
746
747
|
const response = {
|
|
@@ -753,7 +754,7 @@ var de_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (output, contex
|
|
|
753
754
|
if (output.statusCode >= 300) {
|
|
754
755
|
return de_CommandError(output, context);
|
|
755
756
|
}
|
|
756
|
-
const data = await
|
|
757
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
757
758
|
let contents = {};
|
|
758
759
|
contents = (0, import_smithy_client._json)(data);
|
|
759
760
|
const response = {
|
|
@@ -766,7 +767,7 @@ var de_LookupDeveloperIdentityCommand = /* @__PURE__ */ __name(async (output, co
|
|
|
766
767
|
if (output.statusCode >= 300) {
|
|
767
768
|
return de_CommandError(output, context);
|
|
768
769
|
}
|
|
769
|
-
const data = await
|
|
770
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
770
771
|
let contents = {};
|
|
771
772
|
contents = (0, import_smithy_client._json)(data);
|
|
772
773
|
const response = {
|
|
@@ -779,7 +780,7 @@ var de_MergeDeveloperIdentitiesCommand = /* @__PURE__ */ __name(async (output, c
|
|
|
779
780
|
if (output.statusCode >= 300) {
|
|
780
781
|
return de_CommandError(output, context);
|
|
781
782
|
}
|
|
782
|
-
const data = await
|
|
783
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
783
784
|
let contents = {};
|
|
784
785
|
contents = (0, import_smithy_client._json)(data);
|
|
785
786
|
const response = {
|
|
@@ -802,7 +803,7 @@ var de_SetPrincipalTagAttributeMapCommand = /* @__PURE__ */ __name(async (output
|
|
|
802
803
|
if (output.statusCode >= 300) {
|
|
803
804
|
return de_CommandError(output, context);
|
|
804
805
|
}
|
|
805
|
-
const data = await
|
|
806
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
806
807
|
let contents = {};
|
|
807
808
|
contents = (0, import_smithy_client._json)(data);
|
|
808
809
|
const response = {
|
|
@@ -815,7 +816,7 @@ var de_TagResourceCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
|
815
816
|
if (output.statusCode >= 300) {
|
|
816
817
|
return de_CommandError(output, context);
|
|
817
818
|
}
|
|
818
|
-
const data = await
|
|
819
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
819
820
|
let contents = {};
|
|
820
821
|
contents = (0, import_smithy_client._json)(data);
|
|
821
822
|
const response = {
|
|
@@ -848,7 +849,7 @@ var de_UntagResourceCommand = /* @__PURE__ */ __name(async (output, context) =>
|
|
|
848
849
|
if (output.statusCode >= 300) {
|
|
849
850
|
return de_CommandError(output, context);
|
|
850
851
|
}
|
|
851
|
-
const data = await
|
|
852
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
852
853
|
let contents = {};
|
|
853
854
|
contents = (0, import_smithy_client._json)(data);
|
|
854
855
|
const response = {
|
|
@@ -861,7 +862,7 @@ var de_UpdateIdentityPoolCommand = /* @__PURE__ */ __name(async (output, context
|
|
|
861
862
|
if (output.statusCode >= 300) {
|
|
862
863
|
return de_CommandError(output, context);
|
|
863
864
|
}
|
|
864
|
-
const data = await
|
|
865
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
865
866
|
let contents = {};
|
|
866
867
|
contents = (0, import_smithy_client._json)(data);
|
|
867
868
|
const response = {
|
|
@@ -873,9 +874,9 @@ var de_UpdateIdentityPoolCommand = /* @__PURE__ */ __name(async (output, context
|
|
|
873
874
|
var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
874
875
|
const parsedOutput = {
|
|
875
876
|
...output,
|
|
876
|
-
body: await
|
|
877
|
+
body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
|
|
877
878
|
};
|
|
878
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
879
|
+
const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
|
|
879
880
|
switch (errorCode) {
|
|
880
881
|
case "InternalErrorException":
|
|
881
882
|
case "com.amazonaws.cognitoidentity#InternalErrorException":
|
|
@@ -1059,7 +1060,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
|
|
|
1059
1060
|
extendedRequestId: output.headers["x-amz-id-2"],
|
|
1060
1061
|
cfId: output.headers["x-amz-cf-id"]
|
|
1061
1062
|
}), "deserializeMetadata");
|
|
1062
|
-
var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
|
|
1063
1063
|
var throwDefaultError = (0, import_smithy_client.withBaseException)(CognitoIdentityServiceException);
|
|
1064
1064
|
var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
|
|
1065
1065
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
@@ -1086,46 +1086,6 @@ function sharedHeaders(operation) {
|
|
|
1086
1086
|
};
|
|
1087
1087
|
}
|
|
1088
1088
|
__name(sharedHeaders, "sharedHeaders");
|
|
1089
|
-
var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
1090
|
-
if (encoded.length) {
|
|
1091
|
-
return JSON.parse(encoded);
|
|
1092
|
-
}
|
|
1093
|
-
return {};
|
|
1094
|
-
}), "parseBody");
|
|
1095
|
-
var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
|
|
1096
|
-
const value = await parseBody(errorBody, context);
|
|
1097
|
-
value.message = value.message ?? value.Message;
|
|
1098
|
-
return value;
|
|
1099
|
-
}, "parseErrorBody");
|
|
1100
|
-
var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
|
|
1101
|
-
const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
|
|
1102
|
-
const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
|
|
1103
|
-
let cleanValue = rawValue;
|
|
1104
|
-
if (typeof cleanValue === "number") {
|
|
1105
|
-
cleanValue = cleanValue.toString();
|
|
1106
|
-
}
|
|
1107
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
1108
|
-
cleanValue = cleanValue.split(",")[0];
|
|
1109
|
-
}
|
|
1110
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
1111
|
-
cleanValue = cleanValue.split(":")[0];
|
|
1112
|
-
}
|
|
1113
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
1114
|
-
cleanValue = cleanValue.split("#")[1];
|
|
1115
|
-
}
|
|
1116
|
-
return cleanValue;
|
|
1117
|
-
}, "sanitizeErrorCode");
|
|
1118
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
1119
|
-
if (headerKey !== void 0) {
|
|
1120
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
1121
|
-
}
|
|
1122
|
-
if (data.code !== void 0) {
|
|
1123
|
-
return sanitizeErrorCode(data.code);
|
|
1124
|
-
}
|
|
1125
|
-
if (data["__type"] !== void 0) {
|
|
1126
|
-
return sanitizeErrorCode(data["__type"]);
|
|
1127
|
-
}
|
|
1128
|
-
}, "loadRestJsonErrorCode");
|
|
1129
1089
|
|
|
1130
1090
|
// src/commands/CreateIdentityPoolCommand.ts
|
|
1131
1091
|
var _CreateIdentityPoolCommand = class _CreateIdentityPoolCommand 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 { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
|
|
2
3
|
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
|
|
3
4
|
import { CognitoIdentityServiceException as __BaseException } from "../models/CognitoIdentityServiceException";
|
|
@@ -644,43 +645,3 @@ function sharedHeaders(operation) {
|
|
|
644
645
|
"x-amz-target": `AWSCognitoIdentityService.${operation}`,
|
|
645
646
|
};
|
|
646
647
|
}
|
|
647
|
-
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
648
|
-
if (encoded.length) {
|
|
649
|
-
return JSON.parse(encoded);
|
|
650
|
-
}
|
|
651
|
-
return {};
|
|
652
|
-
});
|
|
653
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
654
|
-
const value = await parseBody(errorBody, context);
|
|
655
|
-
value.message = value.message ?? value.Message;
|
|
656
|
-
return value;
|
|
657
|
-
};
|
|
658
|
-
const loadRestJsonErrorCode = (output, data) => {
|
|
659
|
-
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
660
|
-
const sanitizeErrorCode = (rawValue) => {
|
|
661
|
-
let cleanValue = rawValue;
|
|
662
|
-
if (typeof cleanValue === "number") {
|
|
663
|
-
cleanValue = cleanValue.toString();
|
|
664
|
-
}
|
|
665
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
666
|
-
cleanValue = cleanValue.split(",")[0];
|
|
667
|
-
}
|
|
668
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
669
|
-
cleanValue = cleanValue.split(":")[0];
|
|
670
|
-
}
|
|
671
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
672
|
-
cleanValue = cleanValue.split("#")[1];
|
|
673
|
-
}
|
|
674
|
-
return cleanValue;
|
|
675
|
-
};
|
|
676
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
677
|
-
if (headerKey !== undefined) {
|
|
678
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
679
|
-
}
|
|
680
|
-
if (data.code !== undefined) {
|
|
681
|
-
return sanitizeErrorCode(data.code);
|
|
682
|
-
}
|
|
683
|
-
if (data["__type"] !== undefined) {
|
|
684
|
-
return sanitizeErrorCode(data["__type"]);
|
|
685
|
-
}
|
|
686
|
-
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-cognito-identity",
|
|
3
3
|
"description": "AWS SDK for JavaScript Cognito Identity Client for Node.js, Browser and React Native",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.529.0",
|
|
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-cognito-identity",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@aws-crypto/sha256-browser": "3.0.0",
|
|
23
23
|
"@aws-crypto/sha256-js": "3.0.0",
|
|
24
|
-
"@aws-sdk/client-sts": "3.
|
|
25
|
-
"@aws-sdk/core": "3.
|
|
26
|
-
"@aws-sdk/credential-provider-node": "3.
|
|
24
|
+
"@aws-sdk/client-sts": "3.529.0",
|
|
25
|
+
"@aws-sdk/core": "3.529.0",
|
|
26
|
+
"@aws-sdk/credential-provider-node": "3.529.0",
|
|
27
27
|
"@aws-sdk/middleware-host-header": "3.523.0",
|
|
28
28
|
"@aws-sdk/middleware-logger": "3.523.0",
|
|
29
29
|
"@aws-sdk/middleware-recursion-detection": "3.523.0",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"tslib": "^2.5.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@aws-sdk/client-iam": "3.
|
|
64
|
+
"@aws-sdk/client-iam": "3.529.0",
|
|
65
65
|
"@smithy/service-client-documentation-generator": "^2.1.1",
|
|
66
66
|
"@tsconfig/node14": "1.0.3",
|
|
67
67
|
"@types/chai": "^4.2.11",
|