@aws-sdk/client-codecatalyst 3.450.0 → 3.452.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/README.md +64 -1
- package/dist-cjs/CodeCatalyst.js +10 -0
- package/dist-cjs/CodeCatalystClient.js +17 -4
- package/dist-cjs/auth/httpAuthExtensionConfiguration.js +43 -0
- package/dist-cjs/auth/httpAuthSchemeProvider.js +39 -0
- package/dist-cjs/commands/GetWorkflowCommand.js +50 -0
- package/dist-cjs/commands/GetWorkflowRunCommand.js +50 -0
- package/dist-cjs/commands/ListWorkflowRunsCommand.js +50 -0
- package/dist-cjs/commands/ListWorkflowsCommand.js +50 -0
- package/dist-cjs/commands/StartWorkflowRunCommand.js +50 -0
- package/dist-cjs/commands/index.js +5 -0
- package/dist-cjs/models/models_0.js +25 -1
- package/dist-cjs/pagination/ListWorkflowRunsPaginator.js +29 -0
- package/dist-cjs/pagination/ListWorkflowsPaginator.js +29 -0
- package/dist-cjs/pagination/index.js +2 -0
- package/dist-cjs/protocols/Aws_restJson1.js +441 -5
- package/dist-cjs/runtimeConfig.browser.js +11 -0
- package/dist-cjs/runtimeConfig.js +10 -0
- package/dist-cjs/runtimeConfig.shared.js +10 -0
- package/dist-cjs/runtimeExtensions.js +3 -0
- package/dist-es/CodeCatalyst.js +10 -0
- package/dist-es/CodeCatalystClient.js +17 -4
- package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
- package/dist-es/auth/httpAuthSchemeProvider.js +33 -0
- package/dist-es/commands/GetWorkflowCommand.js +46 -0
- package/dist-es/commands/GetWorkflowRunCommand.js +46 -0
- package/dist-es/commands/ListWorkflowRunsCommand.js +46 -0
- package/dist-es/commands/ListWorkflowsCommand.js +46 -0
- package/dist-es/commands/StartWorkflowRunCommand.js +46 -0
- package/dist-es/commands/index.js +5 -0
- package/dist-es/models/models_0.js +24 -0
- package/dist-es/pagination/ListWorkflowRunsPaginator.js +25 -0
- package/dist-es/pagination/ListWorkflowsPaginator.js +25 -0
- package/dist-es/pagination/index.js +2 -0
- package/dist-es/protocols/Aws_restJson1.js +429 -3
- package/dist-es/runtimeConfig.browser.js +11 -0
- package/dist-es/runtimeConfig.js +10 -0
- package/dist-es/runtimeConfig.shared.js +10 -0
- package/dist-es/runtimeExtensions.js +3 -0
- package/dist-types/CodeCatalyst.d.ts +59 -1
- package/dist-types/CodeCatalystClient.d.ts +36 -6
- package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
- package/dist-types/auth/httpAuthSchemeProvider.d.ts +67 -0
- package/dist-types/commands/GetWorkflowCommand.d.ts +107 -0
- package/dist-types/commands/GetWorkflowRunCommand.d.ts +105 -0
- package/dist-types/commands/ListDevEnvironmentsCommand.d.ts +1 -1
- package/dist-types/commands/ListEventLogsCommand.d.ts +10 -1
- package/dist-types/commands/ListWorkflowRunsCommand.d.ts +114 -0
- package/dist-types/commands/ListWorkflowsCommand.d.ts +114 -0
- package/dist-types/commands/StartWorkflowRunCommand.d.ts +99 -0
- package/dist-types/commands/index.d.ts +5 -0
- package/dist-types/extensionConfiguration.d.ts +2 -1
- package/dist-types/index.d.ts +24 -1
- package/dist-types/models/models_0.d.ts +712 -222
- package/dist-types/pagination/ListWorkflowRunsPaginator.d.ts +7 -0
- package/dist-types/pagination/ListWorkflowsPaginator.d.ts +7 -0
- package/dist-types/pagination/index.d.ts +2 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +45 -0
- package/dist-types/runtimeConfig.browser.d.ts +3 -1
- package/dist-types/runtimeConfig.d.ts +3 -1
- package/dist-types/runtimeConfig.native.d.ts +3 -1
- package/dist-types/runtimeConfig.shared.d.ts +2 -0
- package/dist-types/ts3.4/CodeCatalyst.d.ts +85 -0
- package/dist-types/ts3.4/CodeCatalystClient.d.ts +38 -6
- package/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +27 -0
- package/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +40 -0
- package/dist-types/ts3.4/commands/GetWorkflowCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/GetWorkflowRunCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/ListWorkflowRunsCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/ListWorkflowsCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/StartWorkflowRunCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/index.d.ts +5 -0
- package/dist-types/ts3.4/extensionConfiguration.d.ts +3 -1
- package/dist-types/ts3.4/models/models_0.d.ts +190 -61
- package/dist-types/ts3.4/pagination/ListWorkflowRunsPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/ListWorkflowsPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/index.d.ts +2 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +60 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +5 -3
- package/dist-types/ts3.4/runtimeConfig.d.ts +5 -3
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +5 -3
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +2 -0
- package/package.json +38 -34
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
|
|
2
2
|
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, resolvedPath as __resolvedPath, take, withBaseException, } from "@smithy/smithy-client";
|
|
3
|
+
import { v4 as generateIdempotencyToken } from "uuid";
|
|
3
4
|
import { CodeCatalystServiceException as __BaseException } from "../models/CodeCatalystServiceException";
|
|
4
5
|
import { AccessDeniedException, ConflictException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
|
|
5
6
|
export const se_CreateAccessTokenCommand = async (input, context) => {
|
|
@@ -336,6 +337,44 @@ export const se_GetUserDetailsCommand = async (input, context) => {
|
|
|
336
337
|
body,
|
|
337
338
|
});
|
|
338
339
|
};
|
|
340
|
+
export const se_GetWorkflowCommand = async (input, context) => {
|
|
341
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
342
|
+
const headers = {};
|
|
343
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
344
|
+
"/v1/spaces/{spaceName}/projects/{projectName}/workflows/{id}";
|
|
345
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "spaceName", () => input.spaceName, "{spaceName}", false);
|
|
346
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "id", () => input.id, "{id}", false);
|
|
347
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "projectName", () => input.projectName, "{projectName}", false);
|
|
348
|
+
let body;
|
|
349
|
+
return new __HttpRequest({
|
|
350
|
+
protocol,
|
|
351
|
+
hostname,
|
|
352
|
+
port,
|
|
353
|
+
method: "GET",
|
|
354
|
+
headers,
|
|
355
|
+
path: resolvedPath,
|
|
356
|
+
body,
|
|
357
|
+
});
|
|
358
|
+
};
|
|
359
|
+
export const se_GetWorkflowRunCommand = async (input, context) => {
|
|
360
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
361
|
+
const headers = {};
|
|
362
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
363
|
+
"/v1/spaces/{spaceName}/projects/{projectName}/workflowRuns/{id}";
|
|
364
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "spaceName", () => input.spaceName, "{spaceName}", false);
|
|
365
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "id", () => input.id, "{id}", false);
|
|
366
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "projectName", () => input.projectName, "{projectName}", false);
|
|
367
|
+
let body;
|
|
368
|
+
return new __HttpRequest({
|
|
369
|
+
protocol,
|
|
370
|
+
hostname,
|
|
371
|
+
port,
|
|
372
|
+
method: "GET",
|
|
373
|
+
headers,
|
|
374
|
+
path: resolvedPath,
|
|
375
|
+
body,
|
|
376
|
+
});
|
|
377
|
+
};
|
|
339
378
|
export const se_ListAccessTokensCommand = async (input, context) => {
|
|
340
379
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
341
380
|
const headers = {
|
|
@@ -362,15 +401,14 @@ export const se_ListDevEnvironmentsCommand = async (input, context) => {
|
|
|
362
401
|
const headers = {
|
|
363
402
|
"content-type": "application/json",
|
|
364
403
|
};
|
|
365
|
-
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
366
|
-
"/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments";
|
|
404
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/spaces/{spaceName}/devEnvironments";
|
|
367
405
|
resolvedPath = __resolvedPath(resolvedPath, input, "spaceName", () => input.spaceName, "{spaceName}", false);
|
|
368
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "projectName", () => input.projectName, "{projectName}", false);
|
|
369
406
|
let body;
|
|
370
407
|
body = JSON.stringify(take(input, {
|
|
371
408
|
filters: (_) => _json(_),
|
|
372
409
|
maxResults: [],
|
|
373
410
|
nextToken: [],
|
|
411
|
+
projectName: [],
|
|
374
412
|
}));
|
|
375
413
|
return new __HttpRequest({
|
|
376
414
|
protocol,
|
|
@@ -524,6 +562,63 @@ export const se_ListSpacesCommand = async (input, context) => {
|
|
|
524
562
|
body,
|
|
525
563
|
});
|
|
526
564
|
};
|
|
565
|
+
export const se_ListWorkflowRunsCommand = async (input, context) => {
|
|
566
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
567
|
+
const headers = {
|
|
568
|
+
"content-type": "application/json",
|
|
569
|
+
};
|
|
570
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
571
|
+
"/v1/spaces/{spaceName}/projects/{projectName}/workflowRuns";
|
|
572
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "spaceName", () => input.spaceName, "{spaceName}", false);
|
|
573
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "projectName", () => input.projectName, "{projectName}", false);
|
|
574
|
+
const query = map({
|
|
575
|
+
workflowId: [, input.workflowId],
|
|
576
|
+
nextToken: [, input.nextToken],
|
|
577
|
+
maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
|
|
578
|
+
});
|
|
579
|
+
let body;
|
|
580
|
+
body = JSON.stringify(take(input, {
|
|
581
|
+
sortBy: (_) => _json(_),
|
|
582
|
+
}));
|
|
583
|
+
return new __HttpRequest({
|
|
584
|
+
protocol,
|
|
585
|
+
hostname,
|
|
586
|
+
port,
|
|
587
|
+
method: "POST",
|
|
588
|
+
headers,
|
|
589
|
+
path: resolvedPath,
|
|
590
|
+
query,
|
|
591
|
+
body,
|
|
592
|
+
});
|
|
593
|
+
};
|
|
594
|
+
export const se_ListWorkflowsCommand = async (input, context) => {
|
|
595
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
596
|
+
const headers = {
|
|
597
|
+
"content-type": "application/json",
|
|
598
|
+
};
|
|
599
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
600
|
+
"/v1/spaces/{spaceName}/projects/{projectName}/workflows";
|
|
601
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "spaceName", () => input.spaceName, "{spaceName}", false);
|
|
602
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "projectName", () => input.projectName, "{projectName}", false);
|
|
603
|
+
const query = map({
|
|
604
|
+
nextToken: [, input.nextToken],
|
|
605
|
+
maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
|
|
606
|
+
});
|
|
607
|
+
let body;
|
|
608
|
+
body = JSON.stringify(take(input, {
|
|
609
|
+
sortBy: (_) => _json(_),
|
|
610
|
+
}));
|
|
611
|
+
return new __HttpRequest({
|
|
612
|
+
protocol,
|
|
613
|
+
hostname,
|
|
614
|
+
port,
|
|
615
|
+
method: "POST",
|
|
616
|
+
headers,
|
|
617
|
+
path: resolvedPath,
|
|
618
|
+
query,
|
|
619
|
+
body,
|
|
620
|
+
});
|
|
621
|
+
};
|
|
527
622
|
export const se_StartDevEnvironmentCommand = async (input, context) => {
|
|
528
623
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
529
624
|
const headers = {
|
|
@@ -574,6 +669,33 @@ export const se_StartDevEnvironmentSessionCommand = async (input, context) => {
|
|
|
574
669
|
body,
|
|
575
670
|
});
|
|
576
671
|
};
|
|
672
|
+
export const se_StartWorkflowRunCommand = async (input, context) => {
|
|
673
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
674
|
+
const headers = {
|
|
675
|
+
"content-type": "application/json",
|
|
676
|
+
};
|
|
677
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
678
|
+
"/v1/spaces/{spaceName}/projects/{projectName}/workflowRuns";
|
|
679
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "spaceName", () => input.spaceName, "{spaceName}", false);
|
|
680
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "projectName", () => input.projectName, "{projectName}", false);
|
|
681
|
+
const query = map({
|
|
682
|
+
workflowId: [, __expectNonNull(input.workflowId, `workflowId`)],
|
|
683
|
+
});
|
|
684
|
+
let body;
|
|
685
|
+
body = JSON.stringify(take(input, {
|
|
686
|
+
clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
|
|
687
|
+
}));
|
|
688
|
+
return new __HttpRequest({
|
|
689
|
+
protocol,
|
|
690
|
+
hostname,
|
|
691
|
+
port,
|
|
692
|
+
method: "PUT",
|
|
693
|
+
headers,
|
|
694
|
+
path: resolvedPath,
|
|
695
|
+
query,
|
|
696
|
+
body,
|
|
697
|
+
});
|
|
698
|
+
};
|
|
577
699
|
export const se_StopDevEnvironmentCommand = async (input, context) => {
|
|
578
700
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
579
701
|
const headers = {};
|
|
@@ -1563,6 +1685,120 @@ const de_GetUserDetailsCommandError = async (output, context) => {
|
|
|
1563
1685
|
});
|
|
1564
1686
|
}
|
|
1565
1687
|
};
|
|
1688
|
+
export const de_GetWorkflowCommand = async (output, context) => {
|
|
1689
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1690
|
+
return de_GetWorkflowCommandError(output, context);
|
|
1691
|
+
}
|
|
1692
|
+
const contents = map({
|
|
1693
|
+
$metadata: deserializeMetadata(output),
|
|
1694
|
+
});
|
|
1695
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1696
|
+
const doc = take(data, {
|
|
1697
|
+
createdTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
|
|
1698
|
+
definition: _json,
|
|
1699
|
+
id: __expectString,
|
|
1700
|
+
lastUpdatedTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
|
|
1701
|
+
name: __expectString,
|
|
1702
|
+
projectName: __expectString,
|
|
1703
|
+
runMode: __expectString,
|
|
1704
|
+
sourceBranchName: __expectString,
|
|
1705
|
+
sourceRepositoryName: __expectString,
|
|
1706
|
+
spaceName: __expectString,
|
|
1707
|
+
status: __expectString,
|
|
1708
|
+
});
|
|
1709
|
+
Object.assign(contents, doc);
|
|
1710
|
+
return contents;
|
|
1711
|
+
};
|
|
1712
|
+
const de_GetWorkflowCommandError = async (output, context) => {
|
|
1713
|
+
const parsedOutput = {
|
|
1714
|
+
...output,
|
|
1715
|
+
body: await parseErrorBody(output.body, context),
|
|
1716
|
+
};
|
|
1717
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1718
|
+
switch (errorCode) {
|
|
1719
|
+
case "AccessDeniedException":
|
|
1720
|
+
case "com.amazonaws.codecatalyst#AccessDeniedException":
|
|
1721
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1722
|
+
case "ConflictException":
|
|
1723
|
+
case "com.amazonaws.codecatalyst#ConflictException":
|
|
1724
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
1725
|
+
case "ResourceNotFoundException":
|
|
1726
|
+
case "com.amazonaws.codecatalyst#ResourceNotFoundException":
|
|
1727
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1728
|
+
case "ServiceQuotaExceededException":
|
|
1729
|
+
case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
|
|
1730
|
+
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
1731
|
+
case "ThrottlingException":
|
|
1732
|
+
case "com.amazonaws.codecatalyst#ThrottlingException":
|
|
1733
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
1734
|
+
case "ValidationException":
|
|
1735
|
+
case "com.amazonaws.codecatalyst#ValidationException":
|
|
1736
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1737
|
+
default:
|
|
1738
|
+
const parsedBody = parsedOutput.body;
|
|
1739
|
+
return throwDefaultError({
|
|
1740
|
+
output,
|
|
1741
|
+
parsedBody,
|
|
1742
|
+
errorCode,
|
|
1743
|
+
});
|
|
1744
|
+
}
|
|
1745
|
+
};
|
|
1746
|
+
export const de_GetWorkflowRunCommand = async (output, context) => {
|
|
1747
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1748
|
+
return de_GetWorkflowRunCommandError(output, context);
|
|
1749
|
+
}
|
|
1750
|
+
const contents = map({
|
|
1751
|
+
$metadata: deserializeMetadata(output),
|
|
1752
|
+
});
|
|
1753
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1754
|
+
const doc = take(data, {
|
|
1755
|
+
endTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
|
|
1756
|
+
id: __expectString,
|
|
1757
|
+
lastUpdatedTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
|
|
1758
|
+
projectName: __expectString,
|
|
1759
|
+
spaceName: __expectString,
|
|
1760
|
+
startTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
|
|
1761
|
+
status: __expectString,
|
|
1762
|
+
statusReasons: _json,
|
|
1763
|
+
workflowId: __expectString,
|
|
1764
|
+
});
|
|
1765
|
+
Object.assign(contents, doc);
|
|
1766
|
+
return contents;
|
|
1767
|
+
};
|
|
1768
|
+
const de_GetWorkflowRunCommandError = async (output, context) => {
|
|
1769
|
+
const parsedOutput = {
|
|
1770
|
+
...output,
|
|
1771
|
+
body: await parseErrorBody(output.body, context),
|
|
1772
|
+
};
|
|
1773
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1774
|
+
switch (errorCode) {
|
|
1775
|
+
case "AccessDeniedException":
|
|
1776
|
+
case "com.amazonaws.codecatalyst#AccessDeniedException":
|
|
1777
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1778
|
+
case "ConflictException":
|
|
1779
|
+
case "com.amazonaws.codecatalyst#ConflictException":
|
|
1780
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
1781
|
+
case "ResourceNotFoundException":
|
|
1782
|
+
case "com.amazonaws.codecatalyst#ResourceNotFoundException":
|
|
1783
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1784
|
+
case "ServiceQuotaExceededException":
|
|
1785
|
+
case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
|
|
1786
|
+
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
1787
|
+
case "ThrottlingException":
|
|
1788
|
+
case "com.amazonaws.codecatalyst#ThrottlingException":
|
|
1789
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
1790
|
+
case "ValidationException":
|
|
1791
|
+
case "com.amazonaws.codecatalyst#ValidationException":
|
|
1792
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1793
|
+
default:
|
|
1794
|
+
const parsedBody = parsedOutput.body;
|
|
1795
|
+
return throwDefaultError({
|
|
1796
|
+
output,
|
|
1797
|
+
parsedBody,
|
|
1798
|
+
errorCode,
|
|
1799
|
+
});
|
|
1800
|
+
}
|
|
1801
|
+
};
|
|
1566
1802
|
export const de_ListAccessTokensCommand = async (output, context) => {
|
|
1567
1803
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1568
1804
|
return de_ListAccessTokensCommandError(output, context);
|
|
@@ -1955,6 +2191,104 @@ const de_ListSpacesCommandError = async (output, context) => {
|
|
|
1955
2191
|
});
|
|
1956
2192
|
}
|
|
1957
2193
|
};
|
|
2194
|
+
export const de_ListWorkflowRunsCommand = async (output, context) => {
|
|
2195
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2196
|
+
return de_ListWorkflowRunsCommandError(output, context);
|
|
2197
|
+
}
|
|
2198
|
+
const contents = map({
|
|
2199
|
+
$metadata: deserializeMetadata(output),
|
|
2200
|
+
});
|
|
2201
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
2202
|
+
const doc = take(data, {
|
|
2203
|
+
items: (_) => de_WorkflowRunSummaries(_, context),
|
|
2204
|
+
nextToken: __expectString,
|
|
2205
|
+
});
|
|
2206
|
+
Object.assign(contents, doc);
|
|
2207
|
+
return contents;
|
|
2208
|
+
};
|
|
2209
|
+
const de_ListWorkflowRunsCommandError = async (output, context) => {
|
|
2210
|
+
const parsedOutput = {
|
|
2211
|
+
...output,
|
|
2212
|
+
body: await parseErrorBody(output.body, context),
|
|
2213
|
+
};
|
|
2214
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2215
|
+
switch (errorCode) {
|
|
2216
|
+
case "AccessDeniedException":
|
|
2217
|
+
case "com.amazonaws.codecatalyst#AccessDeniedException":
|
|
2218
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
2219
|
+
case "ConflictException":
|
|
2220
|
+
case "com.amazonaws.codecatalyst#ConflictException":
|
|
2221
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
2222
|
+
case "ResourceNotFoundException":
|
|
2223
|
+
case "com.amazonaws.codecatalyst#ResourceNotFoundException":
|
|
2224
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
2225
|
+
case "ServiceQuotaExceededException":
|
|
2226
|
+
case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
|
|
2227
|
+
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
2228
|
+
case "ThrottlingException":
|
|
2229
|
+
case "com.amazonaws.codecatalyst#ThrottlingException":
|
|
2230
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
2231
|
+
case "ValidationException":
|
|
2232
|
+
case "com.amazonaws.codecatalyst#ValidationException":
|
|
2233
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
2234
|
+
default:
|
|
2235
|
+
const parsedBody = parsedOutput.body;
|
|
2236
|
+
return throwDefaultError({
|
|
2237
|
+
output,
|
|
2238
|
+
parsedBody,
|
|
2239
|
+
errorCode,
|
|
2240
|
+
});
|
|
2241
|
+
}
|
|
2242
|
+
};
|
|
2243
|
+
export const de_ListWorkflowsCommand = async (output, context) => {
|
|
2244
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2245
|
+
return de_ListWorkflowsCommandError(output, context);
|
|
2246
|
+
}
|
|
2247
|
+
const contents = map({
|
|
2248
|
+
$metadata: deserializeMetadata(output),
|
|
2249
|
+
});
|
|
2250
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
2251
|
+
const doc = take(data, {
|
|
2252
|
+
items: (_) => de_WorkflowSummaries(_, context),
|
|
2253
|
+
nextToken: __expectString,
|
|
2254
|
+
});
|
|
2255
|
+
Object.assign(contents, doc);
|
|
2256
|
+
return contents;
|
|
2257
|
+
};
|
|
2258
|
+
const de_ListWorkflowsCommandError = async (output, context) => {
|
|
2259
|
+
const parsedOutput = {
|
|
2260
|
+
...output,
|
|
2261
|
+
body: await parseErrorBody(output.body, context),
|
|
2262
|
+
};
|
|
2263
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2264
|
+
switch (errorCode) {
|
|
2265
|
+
case "AccessDeniedException":
|
|
2266
|
+
case "com.amazonaws.codecatalyst#AccessDeniedException":
|
|
2267
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
2268
|
+
case "ConflictException":
|
|
2269
|
+
case "com.amazonaws.codecatalyst#ConflictException":
|
|
2270
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
2271
|
+
case "ResourceNotFoundException":
|
|
2272
|
+
case "com.amazonaws.codecatalyst#ResourceNotFoundException":
|
|
2273
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
2274
|
+
case "ServiceQuotaExceededException":
|
|
2275
|
+
case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
|
|
2276
|
+
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
2277
|
+
case "ThrottlingException":
|
|
2278
|
+
case "com.amazonaws.codecatalyst#ThrottlingException":
|
|
2279
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
2280
|
+
case "ValidationException":
|
|
2281
|
+
case "com.amazonaws.codecatalyst#ValidationException":
|
|
2282
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
2283
|
+
default:
|
|
2284
|
+
const parsedBody = parsedOutput.body;
|
|
2285
|
+
return throwDefaultError({
|
|
2286
|
+
output,
|
|
2287
|
+
parsedBody,
|
|
2288
|
+
errorCode,
|
|
2289
|
+
});
|
|
2290
|
+
}
|
|
2291
|
+
};
|
|
1958
2292
|
export const de_StartDevEnvironmentCommand = async (output, context) => {
|
|
1959
2293
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1960
2294
|
return de_StartDevEnvironmentCommandError(output, context);
|
|
@@ -2058,6 +2392,57 @@ const de_StartDevEnvironmentSessionCommandError = async (output, context) => {
|
|
|
2058
2392
|
});
|
|
2059
2393
|
}
|
|
2060
2394
|
};
|
|
2395
|
+
export const de_StartWorkflowRunCommand = async (output, context) => {
|
|
2396
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2397
|
+
return de_StartWorkflowRunCommandError(output, context);
|
|
2398
|
+
}
|
|
2399
|
+
const contents = map({
|
|
2400
|
+
$metadata: deserializeMetadata(output),
|
|
2401
|
+
});
|
|
2402
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
2403
|
+
const doc = take(data, {
|
|
2404
|
+
id: __expectString,
|
|
2405
|
+
projectName: __expectString,
|
|
2406
|
+
spaceName: __expectString,
|
|
2407
|
+
workflowId: __expectString,
|
|
2408
|
+
});
|
|
2409
|
+
Object.assign(contents, doc);
|
|
2410
|
+
return contents;
|
|
2411
|
+
};
|
|
2412
|
+
const de_StartWorkflowRunCommandError = async (output, context) => {
|
|
2413
|
+
const parsedOutput = {
|
|
2414
|
+
...output,
|
|
2415
|
+
body: await parseErrorBody(output.body, context),
|
|
2416
|
+
};
|
|
2417
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2418
|
+
switch (errorCode) {
|
|
2419
|
+
case "AccessDeniedException":
|
|
2420
|
+
case "com.amazonaws.codecatalyst#AccessDeniedException":
|
|
2421
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
2422
|
+
case "ConflictException":
|
|
2423
|
+
case "com.amazonaws.codecatalyst#ConflictException":
|
|
2424
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
2425
|
+
case "ResourceNotFoundException":
|
|
2426
|
+
case "com.amazonaws.codecatalyst#ResourceNotFoundException":
|
|
2427
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
2428
|
+
case "ServiceQuotaExceededException":
|
|
2429
|
+
case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
|
|
2430
|
+
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
2431
|
+
case "ThrottlingException":
|
|
2432
|
+
case "com.amazonaws.codecatalyst#ThrottlingException":
|
|
2433
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
2434
|
+
case "ValidationException":
|
|
2435
|
+
case "com.amazonaws.codecatalyst#ValidationException":
|
|
2436
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
2437
|
+
default:
|
|
2438
|
+
const parsedBody = parsedOutput.body;
|
|
2439
|
+
return throwDefaultError({
|
|
2440
|
+
output,
|
|
2441
|
+
parsedBody,
|
|
2442
|
+
errorCode,
|
|
2443
|
+
});
|
|
2444
|
+
}
|
|
2445
|
+
};
|
|
2061
2446
|
export const de_StopDevEnvironmentCommand = async (output, context) => {
|
|
2062
2447
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2063
2448
|
return de_StopDevEnvironmentCommandError(output, context);
|
|
@@ -2560,6 +2945,47 @@ const de_ListSourceRepositoryBranchesItems = (output, context) => {
|
|
|
2560
2945
|
});
|
|
2561
2946
|
return retVal;
|
|
2562
2947
|
};
|
|
2948
|
+
const de_WorkflowRunSummaries = (output, context) => {
|
|
2949
|
+
const retVal = (output || [])
|
|
2950
|
+
.filter((e) => e != null)
|
|
2951
|
+
.map((entry) => {
|
|
2952
|
+
return de_WorkflowRunSummary(entry, context);
|
|
2953
|
+
});
|
|
2954
|
+
return retVal;
|
|
2955
|
+
};
|
|
2956
|
+
const de_WorkflowRunSummary = (output, context) => {
|
|
2957
|
+
return take(output, {
|
|
2958
|
+
endTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
|
|
2959
|
+
id: __expectString,
|
|
2960
|
+
lastUpdatedTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
|
|
2961
|
+
startTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
|
|
2962
|
+
status: __expectString,
|
|
2963
|
+
statusReasons: _json,
|
|
2964
|
+
workflowId: __expectString,
|
|
2965
|
+
workflowName: __expectString,
|
|
2966
|
+
});
|
|
2967
|
+
};
|
|
2968
|
+
const de_WorkflowSummaries = (output, context) => {
|
|
2969
|
+
const retVal = (output || [])
|
|
2970
|
+
.filter((e) => e != null)
|
|
2971
|
+
.map((entry) => {
|
|
2972
|
+
return de_WorkflowSummary(entry, context);
|
|
2973
|
+
});
|
|
2974
|
+
return retVal;
|
|
2975
|
+
};
|
|
2976
|
+
const de_WorkflowSummary = (output, context) => {
|
|
2977
|
+
return take(output, {
|
|
2978
|
+
createdTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
|
|
2979
|
+
definition: _json,
|
|
2980
|
+
id: __expectString,
|
|
2981
|
+
lastUpdatedTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
|
|
2982
|
+
name: __expectString,
|
|
2983
|
+
runMode: __expectString,
|
|
2984
|
+
sourceBranchName: __expectString,
|
|
2985
|
+
sourceRepositoryName: __expectString,
|
|
2986
|
+
status: __expectString,
|
|
2987
|
+
});
|
|
2988
|
+
};
|
|
2563
2989
|
const deserializeMetadata = (output) => ({
|
|
2564
2990
|
httpStatusCode: output.statusCode,
|
|
2565
2991
|
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
@@ -2,6 +2,7 @@ import packageInfo from "../package.json";
|
|
|
2
2
|
import { Sha256 } from "@aws-crypto/sha256-browser";
|
|
3
3
|
import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser";
|
|
4
4
|
import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver";
|
|
5
|
+
import { HttpBearerAuthSigner } from "@smithy/core";
|
|
5
6
|
import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler";
|
|
6
7
|
import { calculateBodyLength } from "@smithy/util-body-length-browser";
|
|
7
8
|
import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry";
|
|
@@ -20,6 +21,16 @@ export const getRuntimeConfig = (config) => {
|
|
|
20
21
|
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
21
22
|
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
22
23
|
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
24
|
+
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
25
|
+
{
|
|
26
|
+
schemeId: "smithy.api#httpBearerAuth",
|
|
27
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#httpBearerAuth") ||
|
|
28
|
+
(async () => {
|
|
29
|
+
throw new Error("`token` is missing");
|
|
30
|
+
}),
|
|
31
|
+
signer: new HttpBearerAuthSigner(),
|
|
32
|
+
},
|
|
33
|
+
],
|
|
23
34
|
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
|
|
24
35
|
requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
|
|
25
36
|
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
|
package/dist-es/runtimeConfig.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import packageInfo from "../package.json";
|
|
2
2
|
import { emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core";
|
|
3
|
+
import { nodeProvider } from "@aws-sdk/token-providers";
|
|
3
4
|
import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
|
|
4
5
|
import { NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@smithy/config-resolver";
|
|
6
|
+
import { HttpBearerAuthSigner } from "@smithy/core";
|
|
5
7
|
import { Hash } from "@smithy/hash-node";
|
|
6
8
|
import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry";
|
|
7
9
|
import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider";
|
|
@@ -26,6 +28,14 @@ export const getRuntimeConfig = (config) => {
|
|
|
26
28
|
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
27
29
|
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
28
30
|
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
31
|
+
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
32
|
+
{
|
|
33
|
+
schemeId: "smithy.api#httpBearerAuth",
|
|
34
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#httpBearerAuth") ||
|
|
35
|
+
(async (idProps) => await nodeProvider(idProps?.__config || {})(idProps)),
|
|
36
|
+
signer: new HttpBearerAuthSigner(),
|
|
37
|
+
},
|
|
38
|
+
],
|
|
29
39
|
maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
|
|
30
40
|
requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
|
|
31
41
|
retryMode: config?.retryMode ??
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { HttpBearerAuthSigner } from "@smithy/core";
|
|
1
2
|
import { NoOpLogger } from "@smithy/smithy-client";
|
|
2
3
|
import { parseUrl } from "@smithy/url-parser";
|
|
3
4
|
import { fromBase64, toBase64 } from "@smithy/util-base64";
|
|
4
5
|
import { fromUtf8, toUtf8 } from "@smithy/util-utf8";
|
|
6
|
+
import { defaultCodeCatalystHttpAuthSchemeProvider } from "./auth/httpAuthSchemeProvider";
|
|
5
7
|
import { defaultEndpointResolver } from "./endpoint/endpointResolver";
|
|
6
8
|
export const getRuntimeConfig = (config) => {
|
|
7
9
|
return {
|
|
@@ -11,6 +13,14 @@ export const getRuntimeConfig = (config) => {
|
|
|
11
13
|
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
12
14
|
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
|
|
13
15
|
extensions: config?.extensions ?? [],
|
|
16
|
+
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultCodeCatalystHttpAuthSchemeProvider,
|
|
17
|
+
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
18
|
+
{
|
|
19
|
+
schemeId: "smithy.api#httpBearerAuth",
|
|
20
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#httpBearerAuth"),
|
|
21
|
+
signer: new HttpBearerAuthSigner(),
|
|
22
|
+
},
|
|
23
|
+
],
|
|
14
24
|
logger: config?.logger ?? new NoOpLogger(),
|
|
15
25
|
serviceId: config?.serviceId ?? "CodeCatalyst",
|
|
16
26
|
urlParser: config?.urlParser ?? parseUrl,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, } from "@aws-sdk/region-config-resolver";
|
|
2
2
|
import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http";
|
|
3
3
|
import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client";
|
|
4
|
+
import { getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig } from "./auth/httpAuthExtensionConfiguration";
|
|
4
5
|
const asPartial = (t) => t;
|
|
5
6
|
export const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
6
7
|
const extensionConfiguration = {
|
|
7
8
|
...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)),
|
|
8
9
|
...asPartial(getDefaultExtensionConfiguration(runtimeConfig)),
|
|
9
10
|
...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)),
|
|
11
|
+
...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)),
|
|
10
12
|
};
|
|
11
13
|
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
12
14
|
return {
|
|
@@ -14,5 +16,6 @@ export const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
|
14
16
|
...resolveAwsRegionExtensionConfiguration(extensionConfiguration),
|
|
15
17
|
...resolveDefaultRuntimeConfig(extensionConfiguration),
|
|
16
18
|
...resolveHttpHandlerRuntimeConfig(extensionConfiguration),
|
|
19
|
+
...resolveHttpAuthRuntimeConfig(extensionConfiguration),
|
|
17
20
|
};
|
|
18
21
|
};
|