@aws-sdk/client-workdocs 3.208.0 → 3.210.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 +26 -0
- package/dist-cjs/WorkDocs.js +30 -0
- package/dist-cjs/commands/DeleteDocumentVersionCommand.js +46 -0
- package/dist-cjs/commands/RestoreDocumentVersionsCommand.js +46 -0
- package/dist-cjs/commands/index.js +2 -0
- package/dist-cjs/models/models_0.js +75 -46
- package/dist-cjs/protocols/Aws_restJson1.js +187 -2
- package/dist-cjs/runtimeConfig.shared.js +2 -1
- package/dist-es/WorkDocs.js +30 -0
- package/dist-es/commands/DeleteDocumentVersionCommand.js +42 -0
- package/dist-es/commands/RestoreDocumentVersionsCommand.js +42 -0
- package/dist-es/commands/index.js +2 -0
- package/dist-es/models/models_0.js +65 -38
- package/dist-es/protocols/Aws_restJson1.js +181 -0
- package/dist-es/runtimeConfig.shared.js +2 -1
- package/dist-types/WorkDocs.d.ts +41 -2
- package/dist-types/WorkDocsClient.d.ts +30 -2
- package/dist-types/commands/CreateNotificationSubscriptionCommand.d.ts +1 -2
- package/dist-types/commands/DeleteDocumentVersionCommand.d.ts +37 -0
- package/dist-types/commands/RestoreDocumentVersionsCommand.d.ts +37 -0
- package/dist-types/commands/index.d.ts +2 -0
- package/dist-types/models/models_0.d.ts +108 -51
- package/dist-types/protocols/Aws_restJson1.d.ts +6 -0
- package/dist-types/runtimeConfig.shared.d.ts +2 -3
- package/dist-types/ts3.4/WorkDocs.d.ts +34 -0
- package/dist-types/ts3.4/WorkDocsClient.d.ts +12 -0
- package/dist-types/ts3.4/commands/DeleteDocumentVersionCommand.d.ts +36 -0
- package/dist-types/ts3.4/commands/RestoreDocumentVersionsCommand.d.ts +37 -0
- package/dist-types/ts3.4/commands/index.d.ts +2 -0
- package/dist-types/ts3.4/models/models_0.d.ts +52 -35
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +24 -0
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +2 -3
- package/package.json +11 -13
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.deserializeAws_restJson1UpdateUserCommand = exports.deserializeAws_restJson1UpdateFolderCommand = exports.deserializeAws_restJson1UpdateDocumentVersionCommand = exports.deserializeAws_restJson1UpdateDocumentCommand = exports.deserializeAws_restJson1RemoveResourcePermissionCommand = exports.deserializeAws_restJson1RemoveAllResourcePermissionsCommand = exports.deserializeAws_restJson1InitiateDocumentVersionUploadCommand = exports.deserializeAws_restJson1GetResourcesCommand = exports.deserializeAws_restJson1GetFolderPathCommand = exports.deserializeAws_restJson1GetFolderCommand = exports.deserializeAws_restJson1GetDocumentVersionCommand = exports.deserializeAws_restJson1GetDocumentPathCommand = exports.deserializeAws_restJson1GetDocumentCommand = exports.deserializeAws_restJson1GetCurrentUserCommand = exports.deserializeAws_restJson1DescribeUsersCommand = exports.deserializeAws_restJson1DescribeRootFoldersCommand = exports.deserializeAws_restJson1DescribeResourcePermissionsCommand = exports.deserializeAws_restJson1DescribeNotificationSubscriptionsCommand = exports.deserializeAws_restJson1DescribeGroupsCommand = exports.deserializeAws_restJson1DescribeFolderContentsCommand = exports.deserializeAws_restJson1DescribeDocumentVersionsCommand = exports.deserializeAws_restJson1DescribeCommentsCommand = exports.deserializeAws_restJson1DescribeActivitiesCommand = exports.deserializeAws_restJson1DeleteUserCommand = exports.deserializeAws_restJson1DeleteNotificationSubscriptionCommand = exports.deserializeAws_restJson1DeleteLabelsCommand = exports.deserializeAws_restJson1DeleteFolderContentsCommand = exports.deserializeAws_restJson1DeleteFolderCommand = exports.deserializeAws_restJson1DeleteDocumentCommand = exports.deserializeAws_restJson1DeleteCustomMetadataCommand = exports.deserializeAws_restJson1DeleteCommentCommand = exports.deserializeAws_restJson1DeactivateUserCommand = void 0;
|
|
3
|
+
exports.deserializeAws_restJson1CreateLabelsCommand = exports.deserializeAws_restJson1CreateFolderCommand = exports.deserializeAws_restJson1CreateCustomMetadataCommand = exports.deserializeAws_restJson1CreateCommentCommand = exports.deserializeAws_restJson1AddResourcePermissionsCommand = exports.deserializeAws_restJson1ActivateUserCommand = exports.deserializeAws_restJson1AbortDocumentVersionUploadCommand = exports.serializeAws_restJson1UpdateUserCommand = exports.serializeAws_restJson1UpdateFolderCommand = exports.serializeAws_restJson1UpdateDocumentVersionCommand = exports.serializeAws_restJson1UpdateDocumentCommand = exports.serializeAws_restJson1RestoreDocumentVersionsCommand = exports.serializeAws_restJson1RemoveResourcePermissionCommand = exports.serializeAws_restJson1RemoveAllResourcePermissionsCommand = exports.serializeAws_restJson1InitiateDocumentVersionUploadCommand = exports.serializeAws_restJson1GetResourcesCommand = exports.serializeAws_restJson1GetFolderPathCommand = exports.serializeAws_restJson1GetFolderCommand = exports.serializeAws_restJson1GetDocumentVersionCommand = exports.serializeAws_restJson1GetDocumentPathCommand = exports.serializeAws_restJson1GetDocumentCommand = exports.serializeAws_restJson1GetCurrentUserCommand = exports.serializeAws_restJson1DescribeUsersCommand = exports.serializeAws_restJson1DescribeRootFoldersCommand = exports.serializeAws_restJson1DescribeResourcePermissionsCommand = exports.serializeAws_restJson1DescribeNotificationSubscriptionsCommand = exports.serializeAws_restJson1DescribeGroupsCommand = exports.serializeAws_restJson1DescribeFolderContentsCommand = exports.serializeAws_restJson1DescribeDocumentVersionsCommand = exports.serializeAws_restJson1DescribeCommentsCommand = exports.serializeAws_restJson1DescribeActivitiesCommand = exports.serializeAws_restJson1DeleteUserCommand = exports.serializeAws_restJson1DeleteNotificationSubscriptionCommand = exports.serializeAws_restJson1DeleteLabelsCommand = exports.serializeAws_restJson1DeleteFolderContentsCommand = exports.serializeAws_restJson1DeleteFolderCommand = exports.serializeAws_restJson1DeleteDocumentVersionCommand = exports.serializeAws_restJson1DeleteDocumentCommand = exports.serializeAws_restJson1DeleteCustomMetadataCommand = exports.serializeAws_restJson1DeleteCommentCommand = exports.serializeAws_restJson1DeactivateUserCommand = exports.serializeAws_restJson1CreateUserCommand = exports.serializeAws_restJson1CreateNotificationSubscriptionCommand = exports.serializeAws_restJson1CreateLabelsCommand = exports.serializeAws_restJson1CreateFolderCommand = exports.serializeAws_restJson1CreateCustomMetadataCommand = exports.serializeAws_restJson1CreateCommentCommand = exports.serializeAws_restJson1AddResourcePermissionsCommand = exports.serializeAws_restJson1ActivateUserCommand = exports.serializeAws_restJson1AbortDocumentVersionUploadCommand = void 0;
|
|
4
|
+
exports.deserializeAws_restJson1UpdateUserCommand = exports.deserializeAws_restJson1UpdateFolderCommand = exports.deserializeAws_restJson1UpdateDocumentVersionCommand = exports.deserializeAws_restJson1UpdateDocumentCommand = exports.deserializeAws_restJson1RestoreDocumentVersionsCommand = exports.deserializeAws_restJson1RemoveResourcePermissionCommand = exports.deserializeAws_restJson1RemoveAllResourcePermissionsCommand = exports.deserializeAws_restJson1InitiateDocumentVersionUploadCommand = exports.deserializeAws_restJson1GetResourcesCommand = exports.deserializeAws_restJson1GetFolderPathCommand = exports.deserializeAws_restJson1GetFolderCommand = exports.deserializeAws_restJson1GetDocumentVersionCommand = exports.deserializeAws_restJson1GetDocumentPathCommand = exports.deserializeAws_restJson1GetDocumentCommand = exports.deserializeAws_restJson1GetCurrentUserCommand = exports.deserializeAws_restJson1DescribeUsersCommand = exports.deserializeAws_restJson1DescribeRootFoldersCommand = exports.deserializeAws_restJson1DescribeResourcePermissionsCommand = exports.deserializeAws_restJson1DescribeNotificationSubscriptionsCommand = exports.deserializeAws_restJson1DescribeGroupsCommand = exports.deserializeAws_restJson1DescribeFolderContentsCommand = exports.deserializeAws_restJson1DescribeDocumentVersionsCommand = exports.deserializeAws_restJson1DescribeCommentsCommand = exports.deserializeAws_restJson1DescribeActivitiesCommand = exports.deserializeAws_restJson1DeleteUserCommand = exports.deserializeAws_restJson1DeleteNotificationSubscriptionCommand = exports.deserializeAws_restJson1DeleteLabelsCommand = exports.deserializeAws_restJson1DeleteFolderContentsCommand = exports.deserializeAws_restJson1DeleteFolderCommand = exports.deserializeAws_restJson1DeleteDocumentVersionCommand = exports.deserializeAws_restJson1DeleteDocumentCommand = exports.deserializeAws_restJson1DeleteCustomMetadataCommand = exports.deserializeAws_restJson1DeleteCommentCommand = exports.deserializeAws_restJson1DeactivateUserCommand = exports.deserializeAws_restJson1CreateUserCommand = exports.deserializeAws_restJson1CreateNotificationSubscriptionCommand = void 0;
|
|
5
5
|
const protocol_http_1 = require("@aws-sdk/protocol-http");
|
|
6
6
|
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
7
7
|
const models_0_1 = require("../models/models_0");
|
|
@@ -322,6 +322,31 @@ const serializeAws_restJson1DeleteDocumentCommand = async (input, context) => {
|
|
|
322
322
|
});
|
|
323
323
|
};
|
|
324
324
|
exports.serializeAws_restJson1DeleteDocumentCommand = serializeAws_restJson1DeleteDocumentCommand;
|
|
325
|
+
const serializeAws_restJson1DeleteDocumentVersionCommand = async (input, context) => {
|
|
326
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
327
|
+
const headers = map({}, isSerializableHeaderValue, {
|
|
328
|
+
authentication: input.AuthenticationToken,
|
|
329
|
+
});
|
|
330
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
331
|
+
"/api/v1/documentVersions/{DocumentId}/versions/{VersionId}";
|
|
332
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "DocumentId", () => input.DocumentId, "{DocumentId}", false);
|
|
333
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "VersionId", () => input.VersionId, "{VersionId}", false);
|
|
334
|
+
const query = map({
|
|
335
|
+
deletePriorVersions: [() => input.DeletePriorVersions !== void 0, () => input.DeletePriorVersions.toString()],
|
|
336
|
+
});
|
|
337
|
+
let body;
|
|
338
|
+
return new protocol_http_1.HttpRequest({
|
|
339
|
+
protocol,
|
|
340
|
+
hostname,
|
|
341
|
+
port,
|
|
342
|
+
method: "DELETE",
|
|
343
|
+
headers,
|
|
344
|
+
path: resolvedPath,
|
|
345
|
+
query,
|
|
346
|
+
body,
|
|
347
|
+
});
|
|
348
|
+
};
|
|
349
|
+
exports.serializeAws_restJson1DeleteDocumentVersionCommand = serializeAws_restJson1DeleteDocumentVersionCommand;
|
|
325
350
|
const serializeAws_restJson1DeleteFolderCommand = async (input, context) => {
|
|
326
351
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
327
352
|
const headers = map({}, isSerializableHeaderValue, {
|
|
@@ -916,6 +941,26 @@ const serializeAws_restJson1RemoveResourcePermissionCommand = async (input, cont
|
|
|
916
941
|
});
|
|
917
942
|
};
|
|
918
943
|
exports.serializeAws_restJson1RemoveResourcePermissionCommand = serializeAws_restJson1RemoveResourcePermissionCommand;
|
|
944
|
+
const serializeAws_restJson1RestoreDocumentVersionsCommand = async (input, context) => {
|
|
945
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
946
|
+
const headers = map({}, isSerializableHeaderValue, {
|
|
947
|
+
authentication: input.AuthenticationToken,
|
|
948
|
+
});
|
|
949
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
950
|
+
"/api/v1/documentVersions/restore/{DocumentId}";
|
|
951
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "DocumentId", () => input.DocumentId, "{DocumentId}", false);
|
|
952
|
+
let body;
|
|
953
|
+
return new protocol_http_1.HttpRequest({
|
|
954
|
+
protocol,
|
|
955
|
+
hostname,
|
|
956
|
+
port,
|
|
957
|
+
method: "POST",
|
|
958
|
+
headers,
|
|
959
|
+
path: resolvedPath,
|
|
960
|
+
body,
|
|
961
|
+
});
|
|
962
|
+
};
|
|
963
|
+
exports.serializeAws_restJson1RestoreDocumentVersionsCommand = serializeAws_restJson1RestoreDocumentVersionsCommand;
|
|
919
964
|
const serializeAws_restJson1UpdateDocumentCommand = async (input, context) => {
|
|
920
965
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
921
966
|
const headers = map({}, isSerializableHeaderValue, {
|
|
@@ -1040,6 +1085,9 @@ const deserializeAws_restJson1AbortDocumentVersionUploadCommandError = async (ou
|
|
|
1040
1085
|
};
|
|
1041
1086
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1042
1087
|
switch (errorCode) {
|
|
1088
|
+
case "ConcurrentModificationException":
|
|
1089
|
+
case "com.amazonaws.workdocs#ConcurrentModificationException":
|
|
1090
|
+
throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
|
|
1043
1091
|
case "EntityNotExistsException":
|
|
1044
1092
|
case "com.amazonaws.workdocs#EntityNotExistsException":
|
|
1045
1093
|
throw await deserializeAws_restJson1EntityNotExistsExceptionResponse(parsedOutput, context);
|
|
@@ -1138,6 +1186,9 @@ const deserializeAws_restJson1AddResourcePermissionsCommandError = async (output
|
|
|
1138
1186
|
case "FailedDependencyException":
|
|
1139
1187
|
case "com.amazonaws.workdocs#FailedDependencyException":
|
|
1140
1188
|
throw await deserializeAws_restJson1FailedDependencyExceptionResponse(parsedOutput, context);
|
|
1189
|
+
case "ProhibitedStateException":
|
|
1190
|
+
case "com.amazonaws.workdocs#ProhibitedStateException":
|
|
1191
|
+
throw await deserializeAws_restJson1ProhibitedStateExceptionResponse(parsedOutput, context);
|
|
1141
1192
|
case "ServiceUnavailableException":
|
|
1142
1193
|
case "com.amazonaws.workdocs#ServiceUnavailableException":
|
|
1143
1194
|
throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
|
|
@@ -1282,6 +1333,9 @@ const deserializeAws_restJson1CreateFolderCommandError = async (output, context)
|
|
|
1282
1333
|
};
|
|
1283
1334
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1284
1335
|
switch (errorCode) {
|
|
1336
|
+
case "ConcurrentModificationException":
|
|
1337
|
+
case "com.amazonaws.workdocs#ConcurrentModificationException":
|
|
1338
|
+
throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
|
|
1285
1339
|
case "ConflictingOperationException":
|
|
1286
1340
|
case "com.amazonaws.workdocs#ConflictingOperationException":
|
|
1287
1341
|
throw await deserializeAws_restJson1ConflictingOperationExceptionResponse(parsedOutput, context);
|
|
@@ -1386,6 +1440,9 @@ const deserializeAws_restJson1CreateNotificationSubscriptionCommandError = async
|
|
|
1386
1440
|
};
|
|
1387
1441
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1388
1442
|
switch (errorCode) {
|
|
1443
|
+
case "InvalidArgumentException":
|
|
1444
|
+
case "com.amazonaws.workdocs#InvalidArgumentException":
|
|
1445
|
+
throw await deserializeAws_restJson1InvalidArgumentExceptionResponse(parsedOutput, context);
|
|
1389
1446
|
case "ServiceUnavailableException":
|
|
1390
1447
|
case "com.amazonaws.workdocs#ServiceUnavailableException":
|
|
1391
1448
|
throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
|
|
@@ -1619,6 +1676,9 @@ const deserializeAws_restJson1DeleteDocumentCommandError = async (output, contex
|
|
|
1619
1676
|
case "FailedDependencyException":
|
|
1620
1677
|
case "com.amazonaws.workdocs#FailedDependencyException":
|
|
1621
1678
|
throw await deserializeAws_restJson1FailedDependencyExceptionResponse(parsedOutput, context);
|
|
1679
|
+
case "LimitExceededException":
|
|
1680
|
+
case "com.amazonaws.workdocs#LimitExceededException":
|
|
1681
|
+
throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
|
|
1622
1682
|
case "ProhibitedStateException":
|
|
1623
1683
|
case "com.amazonaws.workdocs#ProhibitedStateException":
|
|
1624
1684
|
throw await deserializeAws_restJson1ProhibitedStateExceptionResponse(parsedOutput, context);
|
|
@@ -1641,6 +1701,58 @@ const deserializeAws_restJson1DeleteDocumentCommandError = async (output, contex
|
|
|
1641
1701
|
});
|
|
1642
1702
|
}
|
|
1643
1703
|
};
|
|
1704
|
+
const deserializeAws_restJson1DeleteDocumentVersionCommand = async (output, context) => {
|
|
1705
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
1706
|
+
return deserializeAws_restJson1DeleteDocumentVersionCommandError(output, context);
|
|
1707
|
+
}
|
|
1708
|
+
const contents = map({
|
|
1709
|
+
$metadata: deserializeMetadata(output),
|
|
1710
|
+
});
|
|
1711
|
+
await collectBody(output.body, context);
|
|
1712
|
+
return contents;
|
|
1713
|
+
};
|
|
1714
|
+
exports.deserializeAws_restJson1DeleteDocumentVersionCommand = deserializeAws_restJson1DeleteDocumentVersionCommand;
|
|
1715
|
+
const deserializeAws_restJson1DeleteDocumentVersionCommandError = async (output, context) => {
|
|
1716
|
+
const parsedOutput = {
|
|
1717
|
+
...output,
|
|
1718
|
+
body: await parseErrorBody(output.body, context),
|
|
1719
|
+
};
|
|
1720
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1721
|
+
switch (errorCode) {
|
|
1722
|
+
case "ConcurrentModificationException":
|
|
1723
|
+
case "com.amazonaws.workdocs#ConcurrentModificationException":
|
|
1724
|
+
throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
|
|
1725
|
+
case "ConflictingOperationException":
|
|
1726
|
+
case "com.amazonaws.workdocs#ConflictingOperationException":
|
|
1727
|
+
throw await deserializeAws_restJson1ConflictingOperationExceptionResponse(parsedOutput, context);
|
|
1728
|
+
case "EntityNotExistsException":
|
|
1729
|
+
case "com.amazonaws.workdocs#EntityNotExistsException":
|
|
1730
|
+
throw await deserializeAws_restJson1EntityNotExistsExceptionResponse(parsedOutput, context);
|
|
1731
|
+
case "FailedDependencyException":
|
|
1732
|
+
case "com.amazonaws.workdocs#FailedDependencyException":
|
|
1733
|
+
throw await deserializeAws_restJson1FailedDependencyExceptionResponse(parsedOutput, context);
|
|
1734
|
+
case "InvalidOperationException":
|
|
1735
|
+
case "com.amazonaws.workdocs#InvalidOperationException":
|
|
1736
|
+
throw await deserializeAws_restJson1InvalidOperationExceptionResponse(parsedOutput, context);
|
|
1737
|
+
case "ProhibitedStateException":
|
|
1738
|
+
case "com.amazonaws.workdocs#ProhibitedStateException":
|
|
1739
|
+
throw await deserializeAws_restJson1ProhibitedStateExceptionResponse(parsedOutput, context);
|
|
1740
|
+
case "UnauthorizedOperationException":
|
|
1741
|
+
case "com.amazonaws.workdocs#UnauthorizedOperationException":
|
|
1742
|
+
throw await deserializeAws_restJson1UnauthorizedOperationExceptionResponse(parsedOutput, context);
|
|
1743
|
+
case "UnauthorizedResourceAccessException":
|
|
1744
|
+
case "com.amazonaws.workdocs#UnauthorizedResourceAccessException":
|
|
1745
|
+
throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
|
|
1746
|
+
default:
|
|
1747
|
+
const parsedBody = parsedOutput.body;
|
|
1748
|
+
(0, smithy_client_1.throwDefaultError)({
|
|
1749
|
+
output,
|
|
1750
|
+
parsedBody,
|
|
1751
|
+
exceptionCtor: WorkDocsServiceException_1.WorkDocsServiceException,
|
|
1752
|
+
errorCode,
|
|
1753
|
+
});
|
|
1754
|
+
}
|
|
1755
|
+
};
|
|
1644
1756
|
const deserializeAws_restJson1DeleteFolderCommand = async (output, context) => {
|
|
1645
1757
|
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
1646
1758
|
return deserializeAws_restJson1DeleteFolderCommandError(output, context);
|
|
@@ -1671,6 +1783,9 @@ const deserializeAws_restJson1DeleteFolderCommandError = async (output, context)
|
|
|
1671
1783
|
case "FailedDependencyException":
|
|
1672
1784
|
case "com.amazonaws.workdocs#FailedDependencyException":
|
|
1673
1785
|
throw await deserializeAws_restJson1FailedDependencyExceptionResponse(parsedOutput, context);
|
|
1786
|
+
case "LimitExceededException":
|
|
1787
|
+
case "com.amazonaws.workdocs#LimitExceededException":
|
|
1788
|
+
throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
|
|
1674
1789
|
case "ProhibitedStateException":
|
|
1675
1790
|
case "com.amazonaws.workdocs#ProhibitedStateException":
|
|
1676
1791
|
throw await deserializeAws_restJson1ProhibitedStateExceptionResponse(parsedOutput, context);
|
|
@@ -1766,6 +1881,9 @@ const deserializeAws_restJson1DeleteLabelsCommandError = async (output, context)
|
|
|
1766
1881
|
case "FailedDependencyException":
|
|
1767
1882
|
case "com.amazonaws.workdocs#FailedDependencyException":
|
|
1768
1883
|
throw await deserializeAws_restJson1FailedDependencyExceptionResponse(parsedOutput, context);
|
|
1884
|
+
case "ProhibitedStateException":
|
|
1885
|
+
case "com.amazonaws.workdocs#ProhibitedStateException":
|
|
1886
|
+
throw await deserializeAws_restJson1ProhibitedStateExceptionResponse(parsedOutput, context);
|
|
1769
1887
|
case "ServiceUnavailableException":
|
|
1770
1888
|
case "com.amazonaws.workdocs#ServiceUnavailableException":
|
|
1771
1889
|
throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
|
|
@@ -2002,6 +2120,9 @@ const deserializeAws_restJson1DescribeDocumentVersionsCommandError = async (outp
|
|
|
2002
2120
|
case "InvalidArgumentException":
|
|
2003
2121
|
case "com.amazonaws.workdocs#InvalidArgumentException":
|
|
2004
2122
|
throw await deserializeAws_restJson1InvalidArgumentExceptionResponse(parsedOutput, context);
|
|
2123
|
+
case "InvalidPasswordException":
|
|
2124
|
+
case "com.amazonaws.workdocs#InvalidPasswordException":
|
|
2125
|
+
throw await deserializeAws_restJson1InvalidPasswordExceptionResponse(parsedOutput, context);
|
|
2005
2126
|
case "ProhibitedStateException":
|
|
2006
2127
|
case "com.amazonaws.workdocs#ProhibitedStateException":
|
|
2007
2128
|
throw await deserializeAws_restJson1ProhibitedStateExceptionResponse(parsedOutput, context);
|
|
@@ -2195,6 +2316,9 @@ const deserializeAws_restJson1DescribeResourcePermissionsCommandError = async (o
|
|
|
2195
2316
|
case "FailedDependencyException":
|
|
2196
2317
|
case "com.amazonaws.workdocs#FailedDependencyException":
|
|
2197
2318
|
throw await deserializeAws_restJson1FailedDependencyExceptionResponse(parsedOutput, context);
|
|
2319
|
+
case "InvalidArgumentException":
|
|
2320
|
+
case "com.amazonaws.workdocs#InvalidArgumentException":
|
|
2321
|
+
throw await deserializeAws_restJson1InvalidArgumentExceptionResponse(parsedOutput, context);
|
|
2198
2322
|
case "ServiceUnavailableException":
|
|
2199
2323
|
case "com.amazonaws.workdocs#ServiceUnavailableException":
|
|
2200
2324
|
throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
|
|
@@ -2712,6 +2836,12 @@ const deserializeAws_restJson1InitiateDocumentVersionUploadCommandError = async
|
|
|
2712
2836
|
case "FailedDependencyException":
|
|
2713
2837
|
case "com.amazonaws.workdocs#FailedDependencyException":
|
|
2714
2838
|
throw await deserializeAws_restJson1FailedDependencyExceptionResponse(parsedOutput, context);
|
|
2839
|
+
case "InvalidPasswordException":
|
|
2840
|
+
case "com.amazonaws.workdocs#InvalidPasswordException":
|
|
2841
|
+
throw await deserializeAws_restJson1InvalidPasswordExceptionResponse(parsedOutput, context);
|
|
2842
|
+
case "LimitExceededException":
|
|
2843
|
+
case "com.amazonaws.workdocs#LimitExceededException":
|
|
2844
|
+
throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
|
|
2715
2845
|
case "ProhibitedStateException":
|
|
2716
2846
|
case "com.amazonaws.workdocs#ProhibitedStateException":
|
|
2717
2847
|
throw await deserializeAws_restJson1ProhibitedStateExceptionResponse(parsedOutput, context);
|
|
@@ -2823,6 +2953,58 @@ const deserializeAws_restJson1RemoveResourcePermissionCommandError = async (outp
|
|
|
2823
2953
|
});
|
|
2824
2954
|
}
|
|
2825
2955
|
};
|
|
2956
|
+
const deserializeAws_restJson1RestoreDocumentVersionsCommand = async (output, context) => {
|
|
2957
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
2958
|
+
return deserializeAws_restJson1RestoreDocumentVersionsCommandError(output, context);
|
|
2959
|
+
}
|
|
2960
|
+
const contents = map({
|
|
2961
|
+
$metadata: deserializeMetadata(output),
|
|
2962
|
+
});
|
|
2963
|
+
await collectBody(output.body, context);
|
|
2964
|
+
return contents;
|
|
2965
|
+
};
|
|
2966
|
+
exports.deserializeAws_restJson1RestoreDocumentVersionsCommand = deserializeAws_restJson1RestoreDocumentVersionsCommand;
|
|
2967
|
+
const deserializeAws_restJson1RestoreDocumentVersionsCommandError = async (output, context) => {
|
|
2968
|
+
const parsedOutput = {
|
|
2969
|
+
...output,
|
|
2970
|
+
body: await parseErrorBody(output.body, context),
|
|
2971
|
+
};
|
|
2972
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2973
|
+
switch (errorCode) {
|
|
2974
|
+
case "ConcurrentModificationException":
|
|
2975
|
+
case "com.amazonaws.workdocs#ConcurrentModificationException":
|
|
2976
|
+
throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
|
|
2977
|
+
case "ConflictingOperationException":
|
|
2978
|
+
case "com.amazonaws.workdocs#ConflictingOperationException":
|
|
2979
|
+
throw await deserializeAws_restJson1ConflictingOperationExceptionResponse(parsedOutput, context);
|
|
2980
|
+
case "EntityNotExistsException":
|
|
2981
|
+
case "com.amazonaws.workdocs#EntityNotExistsException":
|
|
2982
|
+
throw await deserializeAws_restJson1EntityNotExistsExceptionResponse(parsedOutput, context);
|
|
2983
|
+
case "FailedDependencyException":
|
|
2984
|
+
case "com.amazonaws.workdocs#FailedDependencyException":
|
|
2985
|
+
throw await deserializeAws_restJson1FailedDependencyExceptionResponse(parsedOutput, context);
|
|
2986
|
+
case "InvalidOperationException":
|
|
2987
|
+
case "com.amazonaws.workdocs#InvalidOperationException":
|
|
2988
|
+
throw await deserializeAws_restJson1InvalidOperationExceptionResponse(parsedOutput, context);
|
|
2989
|
+
case "ProhibitedStateException":
|
|
2990
|
+
case "com.amazonaws.workdocs#ProhibitedStateException":
|
|
2991
|
+
throw await deserializeAws_restJson1ProhibitedStateExceptionResponse(parsedOutput, context);
|
|
2992
|
+
case "UnauthorizedOperationException":
|
|
2993
|
+
case "com.amazonaws.workdocs#UnauthorizedOperationException":
|
|
2994
|
+
throw await deserializeAws_restJson1UnauthorizedOperationExceptionResponse(parsedOutput, context);
|
|
2995
|
+
case "UnauthorizedResourceAccessException":
|
|
2996
|
+
case "com.amazonaws.workdocs#UnauthorizedResourceAccessException":
|
|
2997
|
+
throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
|
|
2998
|
+
default:
|
|
2999
|
+
const parsedBody = parsedOutput.body;
|
|
3000
|
+
(0, smithy_client_1.throwDefaultError)({
|
|
3001
|
+
output,
|
|
3002
|
+
parsedBody,
|
|
3003
|
+
exceptionCtor: WorkDocsServiceException_1.WorkDocsServiceException,
|
|
3004
|
+
errorCode,
|
|
3005
|
+
});
|
|
3006
|
+
}
|
|
3007
|
+
};
|
|
2826
3008
|
const deserializeAws_restJson1UpdateDocumentCommand = async (output, context) => {
|
|
2827
3009
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2828
3010
|
return deserializeAws_restJson1UpdateDocumentCommandError(output, context);
|
|
@@ -3027,6 +3209,9 @@ const deserializeAws_restJson1UpdateUserCommandError = async (output, context) =
|
|
|
3027
3209
|
case "InvalidArgumentException":
|
|
3028
3210
|
case "com.amazonaws.workdocs#InvalidArgumentException":
|
|
3029
3211
|
throw await deserializeAws_restJson1InvalidArgumentExceptionResponse(parsedOutput, context);
|
|
3212
|
+
case "ProhibitedStateException":
|
|
3213
|
+
case "com.amazonaws.workdocs#ProhibitedStateException":
|
|
3214
|
+
throw await deserializeAws_restJson1ProhibitedStateExceptionResponse(parsedOutput, context);
|
|
3030
3215
|
case "ServiceUnavailableException":
|
|
3031
3216
|
case "com.amazonaws.workdocs#ServiceUnavailableException":
|
|
3032
3217
|
throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getRuntimeConfig = void 0;
|
|
4
|
+
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
4
5
|
const url_parser_1 = require("@aws-sdk/url-parser");
|
|
5
6
|
const util_base64_1 = require("@aws-sdk/util-base64");
|
|
6
7
|
const endpointResolver_1 = require("./endpoint/endpointResolver");
|
|
@@ -10,7 +11,7 @@ const getRuntimeConfig = (config) => ({
|
|
|
10
11
|
base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,
|
|
11
12
|
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
12
13
|
endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,
|
|
13
|
-
logger: config?.logger ??
|
|
14
|
+
logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
|
|
14
15
|
serviceId: config?.serviceId ?? "WorkDocs",
|
|
15
16
|
urlParser: config?.urlParser ?? url_parser_1.parseUrl,
|
|
16
17
|
});
|
package/dist-es/WorkDocs.js
CHANGED
|
@@ -11,6 +11,7 @@ import { DeactivateUserCommand, } from "./commands/DeactivateUserCommand";
|
|
|
11
11
|
import { DeleteCommentCommand, } from "./commands/DeleteCommentCommand";
|
|
12
12
|
import { DeleteCustomMetadataCommand, } from "./commands/DeleteCustomMetadataCommand";
|
|
13
13
|
import { DeleteDocumentCommand, } from "./commands/DeleteDocumentCommand";
|
|
14
|
+
import { DeleteDocumentVersionCommand, } from "./commands/DeleteDocumentVersionCommand";
|
|
14
15
|
import { DeleteFolderCommand, } from "./commands/DeleteFolderCommand";
|
|
15
16
|
import { DeleteFolderContentsCommand, } from "./commands/DeleteFolderContentsCommand";
|
|
16
17
|
import { DeleteLabelsCommand, } from "./commands/DeleteLabelsCommand";
|
|
@@ -35,6 +36,7 @@ import { GetResourcesCommand, } from "./commands/GetResourcesCommand";
|
|
|
35
36
|
import { InitiateDocumentVersionUploadCommand, } from "./commands/InitiateDocumentVersionUploadCommand";
|
|
36
37
|
import { RemoveAllResourcePermissionsCommand, } from "./commands/RemoveAllResourcePermissionsCommand";
|
|
37
38
|
import { RemoveResourcePermissionCommand, } from "./commands/RemoveResourcePermissionCommand";
|
|
39
|
+
import { RestoreDocumentVersionsCommand, } from "./commands/RestoreDocumentVersionsCommand";
|
|
38
40
|
import { UpdateDocumentCommand, } from "./commands/UpdateDocumentCommand";
|
|
39
41
|
import { UpdateDocumentVersionCommand, } from "./commands/UpdateDocumentVersionCommand";
|
|
40
42
|
import { UpdateFolderCommand, } from "./commands/UpdateFolderCommand";
|
|
@@ -223,6 +225,20 @@ export class WorkDocs extends WorkDocsClient {
|
|
|
223
225
|
return this.send(command, optionsOrCb);
|
|
224
226
|
}
|
|
225
227
|
}
|
|
228
|
+
deleteDocumentVersion(args, optionsOrCb, cb) {
|
|
229
|
+
const command = new DeleteDocumentVersionCommand(args);
|
|
230
|
+
if (typeof optionsOrCb === "function") {
|
|
231
|
+
this.send(command, optionsOrCb);
|
|
232
|
+
}
|
|
233
|
+
else if (typeof cb === "function") {
|
|
234
|
+
if (typeof optionsOrCb !== "object")
|
|
235
|
+
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
236
|
+
this.send(command, optionsOrCb || {}, cb);
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
return this.send(command, optionsOrCb);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
226
242
|
deleteFolder(args, optionsOrCb, cb) {
|
|
227
243
|
const command = new DeleteFolderCommand(args);
|
|
228
244
|
if (typeof optionsOrCb === "function") {
|
|
@@ -559,6 +575,20 @@ export class WorkDocs extends WorkDocsClient {
|
|
|
559
575
|
return this.send(command, optionsOrCb);
|
|
560
576
|
}
|
|
561
577
|
}
|
|
578
|
+
restoreDocumentVersions(args, optionsOrCb, cb) {
|
|
579
|
+
const command = new RestoreDocumentVersionsCommand(args);
|
|
580
|
+
if (typeof optionsOrCb === "function") {
|
|
581
|
+
this.send(command, optionsOrCb);
|
|
582
|
+
}
|
|
583
|
+
else if (typeof cb === "function") {
|
|
584
|
+
if (typeof optionsOrCb !== "object")
|
|
585
|
+
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
586
|
+
this.send(command, optionsOrCb || {}, cb);
|
|
587
|
+
}
|
|
588
|
+
else {
|
|
589
|
+
return this.send(command, optionsOrCb);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
562
592
|
updateDocument(args, optionsOrCb, cb) {
|
|
563
593
|
const command = new UpdateDocumentCommand(args);
|
|
564
594
|
if (typeof optionsOrCb === "function") {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
|
|
2
|
+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@aws-sdk/smithy-client";
|
|
4
|
+
import { DeleteDocumentVersionRequestFilterSensitiveLog } from "../models/models_0";
|
|
5
|
+
import { deserializeAws_restJson1DeleteDocumentVersionCommand, serializeAws_restJson1DeleteDocumentVersionCommand, } from "../protocols/Aws_restJson1";
|
|
6
|
+
export class DeleteDocumentVersionCommand extends $Command {
|
|
7
|
+
constructor(input) {
|
|
8
|
+
super();
|
|
9
|
+
this.input = input;
|
|
10
|
+
}
|
|
11
|
+
static getEndpointParameterInstructions() {
|
|
12
|
+
return {
|
|
13
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
14
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
15
|
+
Region: { type: "builtInParams", name: "region" },
|
|
16
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
20
|
+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
21
|
+
this.middlewareStack.use(getEndpointPlugin(configuration, DeleteDocumentVersionCommand.getEndpointParameterInstructions()));
|
|
22
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
23
|
+
const { logger } = configuration;
|
|
24
|
+
const clientName = "WorkDocsClient";
|
|
25
|
+
const commandName = "DeleteDocumentVersionCommand";
|
|
26
|
+
const handlerExecutionContext = {
|
|
27
|
+
logger,
|
|
28
|
+
clientName,
|
|
29
|
+
commandName,
|
|
30
|
+
inputFilterSensitiveLog: DeleteDocumentVersionRequestFilterSensitiveLog,
|
|
31
|
+
outputFilterSensitiveLog: (output) => output,
|
|
32
|
+
};
|
|
33
|
+
const { requestHandler } = configuration;
|
|
34
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
35
|
+
}
|
|
36
|
+
serialize(input, context) {
|
|
37
|
+
return serializeAws_restJson1DeleteDocumentVersionCommand(input, context);
|
|
38
|
+
}
|
|
39
|
+
deserialize(output, context) {
|
|
40
|
+
return deserializeAws_restJson1DeleteDocumentVersionCommand(output, context);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
|
|
2
|
+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@aws-sdk/smithy-client";
|
|
4
|
+
import { RestoreDocumentVersionsRequestFilterSensitiveLog } from "../models/models_0";
|
|
5
|
+
import { deserializeAws_restJson1RestoreDocumentVersionsCommand, serializeAws_restJson1RestoreDocumentVersionsCommand, } from "../protocols/Aws_restJson1";
|
|
6
|
+
export class RestoreDocumentVersionsCommand extends $Command {
|
|
7
|
+
constructor(input) {
|
|
8
|
+
super();
|
|
9
|
+
this.input = input;
|
|
10
|
+
}
|
|
11
|
+
static getEndpointParameterInstructions() {
|
|
12
|
+
return {
|
|
13
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
14
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
15
|
+
Region: { type: "builtInParams", name: "region" },
|
|
16
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
20
|
+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
21
|
+
this.middlewareStack.use(getEndpointPlugin(configuration, RestoreDocumentVersionsCommand.getEndpointParameterInstructions()));
|
|
22
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
23
|
+
const { logger } = configuration;
|
|
24
|
+
const clientName = "WorkDocsClient";
|
|
25
|
+
const commandName = "RestoreDocumentVersionsCommand";
|
|
26
|
+
const handlerExecutionContext = {
|
|
27
|
+
logger,
|
|
28
|
+
clientName,
|
|
29
|
+
commandName,
|
|
30
|
+
inputFilterSensitiveLog: RestoreDocumentVersionsRequestFilterSensitiveLog,
|
|
31
|
+
outputFilterSensitiveLog: (output) => output,
|
|
32
|
+
};
|
|
33
|
+
const { requestHandler } = configuration;
|
|
34
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
35
|
+
}
|
|
36
|
+
serialize(input, context) {
|
|
37
|
+
return serializeAws_restJson1RestoreDocumentVersionsCommand(input, context);
|
|
38
|
+
}
|
|
39
|
+
deserialize(output, context) {
|
|
40
|
+
return deserializeAws_restJson1RestoreDocumentVersionsCommand(output, context);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -11,6 +11,7 @@ export * from "./DeactivateUserCommand";
|
|
|
11
11
|
export * from "./DeleteCommentCommand";
|
|
12
12
|
export * from "./DeleteCustomMetadataCommand";
|
|
13
13
|
export * from "./DeleteDocumentCommand";
|
|
14
|
+
export * from "./DeleteDocumentVersionCommand";
|
|
14
15
|
export * from "./DeleteFolderCommand";
|
|
15
16
|
export * from "./DeleteFolderContentsCommand";
|
|
16
17
|
export * from "./DeleteLabelsCommand";
|
|
@@ -35,6 +36,7 @@ export * from "./GetResourcesCommand";
|
|
|
35
36
|
export * from "./InitiateDocumentVersionUploadCommand";
|
|
36
37
|
export * from "./RemoveAllResourcePermissionsCommand";
|
|
37
38
|
export * from "./RemoveResourcePermissionCommand";
|
|
39
|
+
export * from "./RestoreDocumentVersionsCommand";
|
|
38
40
|
export * from "./UpdateDocumentCommand";
|
|
39
41
|
export * from "./UpdateDocumentVersionCommand";
|
|
40
42
|
export * from "./UpdateFolderCommand";
|