@aws-sdk/client-support-app 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 +8 -48
- package/dist-es/protocols/Aws_restJson1.js +1 -40
- package/package.json +4 -4
package/dist-cjs/index.js
CHANGED
|
@@ -201,6 +201,7 @@ var import_middleware_serde = require("@smithy/middleware-serde");
|
|
|
201
201
|
var import_types = require("@smithy/types");
|
|
202
202
|
|
|
203
203
|
// src/protocols/Aws_restJson1.ts
|
|
204
|
+
var import_core2 = require("@aws-sdk/core");
|
|
204
205
|
|
|
205
206
|
|
|
206
207
|
|
|
@@ -536,7 +537,7 @@ var de_GetAccountAliasCommand = /* @__PURE__ */ __name(async (output, context) =
|
|
|
536
537
|
const contents = (0, import_smithy_client.map)({
|
|
537
538
|
$metadata: deserializeMetadata(output)
|
|
538
539
|
});
|
|
539
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
540
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
540
541
|
const doc = (0, import_smithy_client.take)(data, {
|
|
541
542
|
accountAlias: import_smithy_client.expectString
|
|
542
543
|
});
|
|
@@ -550,7 +551,7 @@ var de_ListSlackChannelConfigurationsCommand = /* @__PURE__ */ __name(async (out
|
|
|
550
551
|
const contents = (0, import_smithy_client.map)({
|
|
551
552
|
$metadata: deserializeMetadata(output)
|
|
552
553
|
});
|
|
553
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
554
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
554
555
|
const doc = (0, import_smithy_client.take)(data, {
|
|
555
556
|
nextToken: import_smithy_client.expectString,
|
|
556
557
|
slackChannelConfigurations: import_smithy_client._json
|
|
@@ -565,7 +566,7 @@ var de_ListSlackWorkspaceConfigurationsCommand = /* @__PURE__ */ __name(async (o
|
|
|
565
566
|
const contents = (0, import_smithy_client.map)({
|
|
566
567
|
$metadata: deserializeMetadata(output)
|
|
567
568
|
});
|
|
568
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
569
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
569
570
|
const doc = (0, import_smithy_client.take)(data, {
|
|
570
571
|
nextToken: import_smithy_client.expectString,
|
|
571
572
|
slackWorkspaceConfigurations: import_smithy_client._json
|
|
@@ -590,7 +591,7 @@ var de_RegisterSlackWorkspaceForOrganizationCommand = /* @__PURE__ */ __name(asy
|
|
|
590
591
|
const contents = (0, import_smithy_client.map)({
|
|
591
592
|
$metadata: deserializeMetadata(output)
|
|
592
593
|
});
|
|
593
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
594
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
594
595
|
const doc = (0, import_smithy_client.take)(data, {
|
|
595
596
|
accountType: import_smithy_client.expectString,
|
|
596
597
|
teamId: import_smithy_client.expectString,
|
|
@@ -606,7 +607,7 @@ var de_UpdateSlackChannelConfigurationCommand = /* @__PURE__ */ __name(async (ou
|
|
|
606
607
|
const contents = (0, import_smithy_client.map)({
|
|
607
608
|
$metadata: deserializeMetadata(output)
|
|
608
609
|
});
|
|
609
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
610
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
610
611
|
const doc = (0, import_smithy_client.take)(data, {
|
|
611
612
|
channelId: import_smithy_client.expectString,
|
|
612
613
|
channelName: import_smithy_client.expectString,
|
|
@@ -623,9 +624,9 @@ var de_UpdateSlackChannelConfigurationCommand = /* @__PURE__ */ __name(async (ou
|
|
|
623
624
|
var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
624
625
|
const parsedOutput = {
|
|
625
626
|
...output,
|
|
626
|
-
body: await
|
|
627
|
+
body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
|
|
627
628
|
};
|
|
628
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
629
|
+
const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
|
|
629
630
|
switch (errorCode) {
|
|
630
631
|
case "AccessDeniedException":
|
|
631
632
|
case "com.amazonaws.supportapp#AccessDeniedException":
|
|
@@ -739,47 +740,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
|
|
|
739
740
|
extendedRequestId: output.headers["x-amz-id-2"],
|
|
740
741
|
cfId: output.headers["x-amz-cf-id"]
|
|
741
742
|
}), "deserializeMetadata");
|
|
742
|
-
var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
|
|
743
|
-
var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
744
|
-
if (encoded.length) {
|
|
745
|
-
return JSON.parse(encoded);
|
|
746
|
-
}
|
|
747
|
-
return {};
|
|
748
|
-
}), "parseBody");
|
|
749
|
-
var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
|
|
750
|
-
const value = await parseBody(errorBody, context);
|
|
751
|
-
value.message = value.message ?? value.Message;
|
|
752
|
-
return value;
|
|
753
|
-
}, "parseErrorBody");
|
|
754
|
-
var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
|
|
755
|
-
const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
|
|
756
|
-
const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
|
|
757
|
-
let cleanValue = rawValue;
|
|
758
|
-
if (typeof cleanValue === "number") {
|
|
759
|
-
cleanValue = cleanValue.toString();
|
|
760
|
-
}
|
|
761
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
762
|
-
cleanValue = cleanValue.split(",")[0];
|
|
763
|
-
}
|
|
764
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
765
|
-
cleanValue = cleanValue.split(":")[0];
|
|
766
|
-
}
|
|
767
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
768
|
-
cleanValue = cleanValue.split("#")[1];
|
|
769
|
-
}
|
|
770
|
-
return cleanValue;
|
|
771
|
-
}, "sanitizeErrorCode");
|
|
772
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
773
|
-
if (headerKey !== void 0) {
|
|
774
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
775
|
-
}
|
|
776
|
-
if (data.code !== void 0) {
|
|
777
|
-
return sanitizeErrorCode(data.code);
|
|
778
|
-
}
|
|
779
|
-
if (data["__type"] !== void 0) {
|
|
780
|
-
return sanitizeErrorCode(data["__type"]);
|
|
781
|
-
}
|
|
782
|
-
}, "loadRestJsonErrorCode");
|
|
783
743
|
|
|
784
744
|
// src/commands/CreateSlackChannelConfigurationCommand.ts
|
|
785
745
|
var _CreateSlackChannelConfigurationCommand = class _CreateSlackChannelConfigurationCommand 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, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map, take, withBaseException, } from "@smithy/smithy-client";
|
|
3
4
|
import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ValidationException, } from "../models/models_0";
|
|
@@ -399,43 +400,3 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
|
399
400
|
value !== "" &&
|
|
400
401
|
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
401
402
|
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
402
|
-
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
403
|
-
if (encoded.length) {
|
|
404
|
-
return JSON.parse(encoded);
|
|
405
|
-
}
|
|
406
|
-
return {};
|
|
407
|
-
});
|
|
408
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
409
|
-
const value = await parseBody(errorBody, context);
|
|
410
|
-
value.message = value.message ?? value.Message;
|
|
411
|
-
return value;
|
|
412
|
-
};
|
|
413
|
-
const loadRestJsonErrorCode = (output, data) => {
|
|
414
|
-
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
415
|
-
const sanitizeErrorCode = (rawValue) => {
|
|
416
|
-
let cleanValue = rawValue;
|
|
417
|
-
if (typeof cleanValue === "number") {
|
|
418
|
-
cleanValue = cleanValue.toString();
|
|
419
|
-
}
|
|
420
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
421
|
-
cleanValue = cleanValue.split(",")[0];
|
|
422
|
-
}
|
|
423
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
424
|
-
cleanValue = cleanValue.split(":")[0];
|
|
425
|
-
}
|
|
426
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
427
|
-
cleanValue = cleanValue.split("#")[1];
|
|
428
|
-
}
|
|
429
|
-
return cleanValue;
|
|
430
|
-
};
|
|
431
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
432
|
-
if (headerKey !== undefined) {
|
|
433
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
434
|
-
}
|
|
435
|
-
if (data.code !== undefined) {
|
|
436
|
-
return sanitizeErrorCode(data.code);
|
|
437
|
-
}
|
|
438
|
-
if (data["__type"] !== undefined) {
|
|
439
|
-
return sanitizeErrorCode(data["__type"]);
|
|
440
|
-
}
|
|
441
|
-
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-support-app",
|
|
3
3
|
"description": "AWS SDK for JavaScript Support App 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-support-app",
|
|
@@ -20,9 +20,9 @@
|
|
|
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.
|
|
25
|
-
"@aws-sdk/credential-provider-node": "3.
|
|
23
|
+
"@aws-sdk/client-sts": "3.529.0",
|
|
24
|
+
"@aws-sdk/core": "3.529.0",
|
|
25
|
+
"@aws-sdk/credential-provider-node": "3.529.0",
|
|
26
26
|
"@aws-sdk/middleware-host-header": "3.523.0",
|
|
27
27
|
"@aws-sdk/middleware-logger": "3.523.0",
|
|
28
28
|
"@aws-sdk/middleware-recursion-detection": "3.523.0",
|