onehook-api-client 1.0.14 → 1.0.15
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 +14 -0
- package/dist-cjs/OneHook.js +4 -0
- package/dist-cjs/commands/CreateMediaDownloadUrlCommand.js +21 -0
- package/dist-cjs/commands/CreateMediaUploadUrlCommand.js +21 -0
- package/dist-cjs/commands/index.js +2 -0
- package/dist-cjs/models/models_0.js +7 -1
- package/dist-cjs/protocols/Aws_restJson1.js +71 -2
- package/dist-es/OneHook.js +4 -0
- package/dist-es/commands/CreateMediaDownloadUrlCommand.js +17 -0
- package/dist-es/commands/CreateMediaUploadUrlCommand.js +17 -0
- package/dist-es/commands/index.js +2 -0
- package/dist-es/models/models_0.js +6 -0
- package/dist-es/protocols/Aws_restJson1.js +64 -0
- package/dist-types/OneHook.d.ts +14 -0
- package/dist-types/OneHookClient.d.ts +4 -2
- package/dist-types/commands/CreateMediaDownloadUrlCommand.d.ts +87 -0
- package/dist-types/commands/CreateMediaUploadUrlCommand.d.ts +92 -0
- package/dist-types/commands/index.d.ts +2 -0
- package/dist-types/models/models_0.d.ts +92 -15
- package/dist-types/protocols/Aws_restJson1.d.ts +18 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -197,6 +197,20 @@ see LICENSE for more information.
|
|
|
197
197
|
|
|
198
198
|
## Client Commands (Operations List)
|
|
199
199
|
|
|
200
|
+
<details>
|
|
201
|
+
<summary>
|
|
202
|
+
CreateMediaDownloadUrl
|
|
203
|
+
</summary>
|
|
204
|
+
|
|
205
|
+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/onehook/command/CreateMediaDownloadUrlCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-onehook/Interface/CreateMediaDownloadUrlCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-onehook/Interface/CreateMediaDownloadUrlCommandOutput/)
|
|
206
|
+
</details>
|
|
207
|
+
<details>
|
|
208
|
+
<summary>
|
|
209
|
+
CreateMediaUploadUrl
|
|
210
|
+
</summary>
|
|
211
|
+
|
|
212
|
+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/onehook/command/CreateMediaUploadUrlCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-onehook/Interface/CreateMediaUploadUrlCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-onehook/Interface/CreateMediaUploadUrlCommandOutput/)
|
|
213
|
+
</details>
|
|
200
214
|
<details>
|
|
201
215
|
<summary>
|
|
202
216
|
DeleteMatchMessages
|
package/dist-cjs/OneHook.js
CHANGED
|
@@ -6,6 +6,8 @@ const AuthSocialCommand_1 = require("./commands/AuthSocialCommand");
|
|
|
6
6
|
const CompleteLivenessSessionCommand_1 = require("./commands/CompleteLivenessSessionCommand");
|
|
7
7
|
const CompleteOnboardingCommand_1 = require("./commands/CompleteOnboardingCommand");
|
|
8
8
|
const CreateLivenessSessionCommand_1 = require("./commands/CreateLivenessSessionCommand");
|
|
9
|
+
const CreateMediaDownloadUrlCommand_1 = require("./commands/CreateMediaDownloadUrlCommand");
|
|
10
|
+
const CreateMediaUploadUrlCommand_1 = require("./commands/CreateMediaUploadUrlCommand");
|
|
9
11
|
const DeleteMatchMessagesCommand_1 = require("./commands/DeleteMatchMessagesCommand");
|
|
10
12
|
const DeleteProfileCommand_1 = require("./commands/DeleteProfileCommand");
|
|
11
13
|
const DeletePushTokenCommand_1 = require("./commands/DeletePushTokenCommand");
|
|
@@ -53,6 +55,8 @@ const UpgradeUserCommand_1 = require("./commands/UpgradeUserCommand");
|
|
|
53
55
|
const ValidateInviteCommand_1 = require("./commands/ValidateInviteCommand");
|
|
54
56
|
const smithy_client_1 = require("@smithy/smithy-client");
|
|
55
57
|
const commands = {
|
|
58
|
+
CreateMediaDownloadUrlCommand: CreateMediaDownloadUrlCommand_1.CreateMediaDownloadUrlCommand,
|
|
59
|
+
CreateMediaUploadUrlCommand: CreateMediaUploadUrlCommand_1.CreateMediaUploadUrlCommand,
|
|
56
60
|
DeleteMatchMessagesCommand: DeleteMatchMessagesCommand_1.DeleteMatchMessagesCommand,
|
|
57
61
|
DeletePushTokenCommand: DeletePushTokenCommand_1.DeletePushTokenCommand,
|
|
58
62
|
GetChatSettingsCommand: GetChatSettingsCommand_1.GetChatSettingsCommand,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateMediaDownloadUrlCommand = exports.$Command = void 0;
|
|
4
|
+
const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
|
|
5
|
+
const middleware_serde_1 = require("@smithy/middleware-serde");
|
|
6
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
7
|
+
Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
|
|
8
|
+
class CreateMediaDownloadUrlCommand extends smithy_client_1.Command.classBuilder()
|
|
9
|
+
.m(function (Command, cs, config, o) {
|
|
10
|
+
return [
|
|
11
|
+
(0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
12
|
+
];
|
|
13
|
+
})
|
|
14
|
+
.s("OneHookService", "CreateMediaDownloadUrl", {})
|
|
15
|
+
.n("OneHookClient", "CreateMediaDownloadUrlCommand")
|
|
16
|
+
.f(void 0, void 0)
|
|
17
|
+
.ser(Aws_restJson1_1.se_CreateMediaDownloadUrlCommand)
|
|
18
|
+
.de(Aws_restJson1_1.de_CreateMediaDownloadUrlCommand)
|
|
19
|
+
.build() {
|
|
20
|
+
}
|
|
21
|
+
exports.CreateMediaDownloadUrlCommand = CreateMediaDownloadUrlCommand;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateMediaUploadUrlCommand = exports.$Command = void 0;
|
|
4
|
+
const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
|
|
5
|
+
const middleware_serde_1 = require("@smithy/middleware-serde");
|
|
6
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
7
|
+
Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
|
|
8
|
+
class CreateMediaUploadUrlCommand extends smithy_client_1.Command.classBuilder()
|
|
9
|
+
.m(function (Command, cs, config, o) {
|
|
10
|
+
return [
|
|
11
|
+
(0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
12
|
+
];
|
|
13
|
+
})
|
|
14
|
+
.s("OneHookService", "CreateMediaUploadUrl", {})
|
|
15
|
+
.n("OneHookClient", "CreateMediaUploadUrlCommand")
|
|
16
|
+
.f(void 0, void 0)
|
|
17
|
+
.ser(Aws_restJson1_1.se_CreateMediaUploadUrlCommand)
|
|
18
|
+
.de(Aws_restJson1_1.de_CreateMediaUploadUrlCommand)
|
|
19
|
+
.build() {
|
|
20
|
+
}
|
|
21
|
+
exports.CreateMediaUploadUrlCommand = CreateMediaUploadUrlCommand;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./CreateMediaDownloadUrlCommand"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./CreateMediaUploadUrlCommand"), exports);
|
|
4
6
|
tslib_1.__exportStar(require("./DeleteMatchMessagesCommand"), exports);
|
|
5
7
|
tslib_1.__exportStar(require("./DeletePushTokenCommand"), exports);
|
|
6
8
|
tslib_1.__exportStar(require("./GetChatSettingsCommand"), exports);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CredentialGap = exports.DeviceLimitError = exports.Platform = exports.LastSeenVisibility = exports.NotFoundError = exports.InternalServerError = exports.BadRequestError = exports.ForbiddenError = void 0;
|
|
3
|
+
exports.CredentialGap = exports.DeviceLimitError = exports.Platform = exports.LastSeenVisibility = exports.MediaKind = exports.NotFoundError = exports.InternalServerError = exports.BadRequestError = exports.ForbiddenError = void 0;
|
|
4
4
|
const OneHookServiceException_1 = require("./OneHookServiceException");
|
|
5
5
|
class ForbiddenError extends OneHookServiceException_1.OneHookServiceException {
|
|
6
6
|
name = "ForbiddenError";
|
|
@@ -62,6 +62,12 @@ class NotFoundError extends OneHookServiceException_1.OneHookServiceException {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
exports.NotFoundError = NotFoundError;
|
|
65
|
+
exports.MediaKind = {
|
|
66
|
+
AUDIO: "AUDIO",
|
|
67
|
+
FILE: "FILE",
|
|
68
|
+
IMAGE: "IMAGE",
|
|
69
|
+
VIDEO: "VIDEO",
|
|
70
|
+
};
|
|
65
71
|
exports.LastSeenVisibility = {
|
|
66
72
|
EVERYONE: "EVERYONE",
|
|
67
73
|
MATCHES: "MATCHES",
|
|
@@ -1,12 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
3
|
+
exports.se_UnhookCommand = exports.se_InitUserCommand = exports.se_GetStateCommand = exports.se_GetMatchCommand = exports.se_CompleteOnboardingCommand = exports.se_UpdateProfileCommand = exports.se_GetProfileCommand = exports.se_GetMyProfileCommand = exports.se_GetLivenessStatusCommand = exports.se_GenerateUploadUrlCommand = exports.se_GenerateDownloadUrlCommand = exports.se_DeleteProfileCommand = exports.se_CreateLivenessSessionCommand = exports.se_CompleteLivenessSessionCommand = exports.se_UpdatePreferencesCommand = exports.se_SwipeByUsernameCommand = exports.se_SwipeCommand = exports.se_RemoveLocationCommand = exports.se_IndexLocationCommand = exports.se_GetPreferencesCommand = exports.se_GetNotificationPreferencesCommand = exports.se_DiscoverCommand = exports.se_ValidateInviteCommand = exports.se_UpdateUsernameCommand = exports.se_UpdatePhoneNumberCommand = exports.se_UpdateEntitlementsCommand = exports.se_UnlinkSocialCommand = exports.se_RequestPhoneUpdateOtpCommand = exports.se_RequestPhoneOtpCommand = exports.se_RequestEmailOtpCommand = exports.se_RegisterPhoneCommand = exports.se_LinkSocialCommand = exports.se_LinkEmailCommand = exports.se_GetUserIdByUsernameCommand = exports.se_GetUserByEmailCommand = exports.se_GetUserCommand = exports.se_GetCredentialReadinessCommand = exports.se_GenerateInviteCommand = exports.se_AuthSocialCommand = exports.se_UpdateChatSettingsCommand = exports.se_RevokeDeviceCommand = exports.se_RegisterPushTokenCommand = exports.se_RegisterDeviceCommand = exports.se_ListMyDevicesCommand = exports.se_GetParticipantRegistryCommand = exports.se_GetChatSettingsCommand = exports.se_DeletePushTokenCommand = exports.se_DeleteMatchMessagesCommand = exports.se_CreateMediaUploadUrlCommand = exports.se_CreateMediaDownloadUrlCommand = void 0;
|
|
4
|
+
exports.de_InitUserCommand = exports.de_GetStateCommand = exports.de_GetMatchCommand = exports.de_CompleteOnboardingCommand = exports.de_UpdateProfileCommand = exports.de_GetProfileCommand = exports.de_GetMyProfileCommand = exports.de_GetLivenessStatusCommand = exports.de_GenerateUploadUrlCommand = exports.de_GenerateDownloadUrlCommand = exports.de_DeleteProfileCommand = exports.de_CreateLivenessSessionCommand = exports.de_CompleteLivenessSessionCommand = exports.de_UpdatePreferencesCommand = exports.de_SwipeByUsernameCommand = exports.de_SwipeCommand = exports.de_RemoveLocationCommand = exports.de_IndexLocationCommand = exports.de_GetPreferencesCommand = exports.de_GetNotificationPreferencesCommand = exports.de_DiscoverCommand = exports.de_ValidateInviteCommand = exports.de_UpdateUsernameCommand = exports.de_UpdatePhoneNumberCommand = exports.de_UpdateEntitlementsCommand = exports.de_UnlinkSocialCommand = exports.de_RequestPhoneUpdateOtpCommand = exports.de_RequestPhoneOtpCommand = exports.de_RequestEmailOtpCommand = exports.de_RegisterPhoneCommand = exports.de_LinkSocialCommand = exports.de_LinkEmailCommand = exports.de_GetUserIdByUsernameCommand = exports.de_GetUserByEmailCommand = exports.de_GetUserCommand = exports.de_GetCredentialReadinessCommand = exports.de_GenerateInviteCommand = exports.de_AuthSocialCommand = exports.de_UpdateChatSettingsCommand = exports.de_RevokeDeviceCommand = exports.de_RegisterPushTokenCommand = exports.de_RegisterDeviceCommand = exports.de_ListMyDevicesCommand = exports.de_GetParticipantRegistryCommand = exports.de_GetChatSettingsCommand = exports.de_DeletePushTokenCommand = exports.de_DeleteMatchMessagesCommand = exports.de_CreateMediaUploadUrlCommand = exports.de_CreateMediaDownloadUrlCommand = exports.se_UpgradeUserCommand = void 0;
|
|
5
|
+
exports.de_UpgradeUserCommand = exports.de_UnhookCommand = void 0;
|
|
5
6
|
const OneHookServiceException_1 = require("../models/OneHookServiceException");
|
|
6
7
|
const models_0_1 = require("../models/models_0");
|
|
7
8
|
const core_1 = require("@aws-sdk/core");
|
|
8
9
|
const core_2 = require("@smithy/core");
|
|
9
10
|
const smithy_client_1 = require("@smithy/smithy-client");
|
|
11
|
+
const se_CreateMediaDownloadUrlCommand = async (input, context) => {
|
|
12
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
13
|
+
const headers = {
|
|
14
|
+
'content-type': 'application/json',
|
|
15
|
+
};
|
|
16
|
+
b.bp("/chat/media/download-url");
|
|
17
|
+
let body;
|
|
18
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
19
|
+
'matchId': [],
|
|
20
|
+
'objectKey': [],
|
|
21
|
+
}));
|
|
22
|
+
b.m("POST")
|
|
23
|
+
.h(headers)
|
|
24
|
+
.b(body);
|
|
25
|
+
return b.build();
|
|
26
|
+
};
|
|
27
|
+
exports.se_CreateMediaDownloadUrlCommand = se_CreateMediaDownloadUrlCommand;
|
|
28
|
+
const se_CreateMediaUploadUrlCommand = async (input, context) => {
|
|
29
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
30
|
+
const headers = {
|
|
31
|
+
'content-type': 'application/json',
|
|
32
|
+
};
|
|
33
|
+
b.bp("/chat/media/upload-url");
|
|
34
|
+
let body;
|
|
35
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
36
|
+
'contentLength': [],
|
|
37
|
+
'kind': [],
|
|
38
|
+
'matchId': [],
|
|
39
|
+
}));
|
|
40
|
+
b.m("POST")
|
|
41
|
+
.h(headers)
|
|
42
|
+
.b(body);
|
|
43
|
+
return b.build();
|
|
44
|
+
};
|
|
45
|
+
exports.se_CreateMediaUploadUrlCommand = se_CreateMediaUploadUrlCommand;
|
|
10
46
|
const se_DeleteMatchMessagesCommand = async (input, context) => {
|
|
11
47
|
const b = (0, core_2.requestBuilder)(input, context);
|
|
12
48
|
const headers = {};
|
|
@@ -789,6 +825,39 @@ const se_UpgradeUserCommand = async (input, context) => {
|
|
|
789
825
|
return b.build();
|
|
790
826
|
};
|
|
791
827
|
exports.se_UpgradeUserCommand = se_UpgradeUserCommand;
|
|
828
|
+
const de_CreateMediaDownloadUrlCommand = async (output, context) => {
|
|
829
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
830
|
+
return de_CommandError(output, context);
|
|
831
|
+
}
|
|
832
|
+
const contents = (0, smithy_client_1.map)({
|
|
833
|
+
$metadata: deserializeMetadata(output),
|
|
834
|
+
});
|
|
835
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
836
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
837
|
+
'downloadUrl': smithy_client_1.expectString,
|
|
838
|
+
'expiresInSeconds': smithy_client_1.expectInt32,
|
|
839
|
+
});
|
|
840
|
+
Object.assign(contents, doc);
|
|
841
|
+
return contents;
|
|
842
|
+
};
|
|
843
|
+
exports.de_CreateMediaDownloadUrlCommand = de_CreateMediaDownloadUrlCommand;
|
|
844
|
+
const de_CreateMediaUploadUrlCommand = async (output, context) => {
|
|
845
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
846
|
+
return de_CommandError(output, context);
|
|
847
|
+
}
|
|
848
|
+
const contents = (0, smithy_client_1.map)({
|
|
849
|
+
$metadata: deserializeMetadata(output),
|
|
850
|
+
});
|
|
851
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
852
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
853
|
+
'expiresInSeconds': smithy_client_1.expectInt32,
|
|
854
|
+
'objectKey': smithy_client_1.expectString,
|
|
855
|
+
'uploadUrl': smithy_client_1.expectString,
|
|
856
|
+
});
|
|
857
|
+
Object.assign(contents, doc);
|
|
858
|
+
return contents;
|
|
859
|
+
};
|
|
860
|
+
exports.de_CreateMediaUploadUrlCommand = de_CreateMediaUploadUrlCommand;
|
|
792
861
|
const de_DeleteMatchMessagesCommand = async (output, context) => {
|
|
793
862
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
794
863
|
return de_CommandError(output, context);
|
package/dist-es/OneHook.js
CHANGED
|
@@ -3,6 +3,8 @@ import { AuthSocialCommand, } from "./commands/AuthSocialCommand";
|
|
|
3
3
|
import { CompleteLivenessSessionCommand, } from "./commands/CompleteLivenessSessionCommand";
|
|
4
4
|
import { CompleteOnboardingCommand, } from "./commands/CompleteOnboardingCommand";
|
|
5
5
|
import { CreateLivenessSessionCommand, } from "./commands/CreateLivenessSessionCommand";
|
|
6
|
+
import { CreateMediaDownloadUrlCommand, } from "./commands/CreateMediaDownloadUrlCommand";
|
|
7
|
+
import { CreateMediaUploadUrlCommand, } from "./commands/CreateMediaUploadUrlCommand";
|
|
6
8
|
import { DeleteMatchMessagesCommand, } from "./commands/DeleteMatchMessagesCommand";
|
|
7
9
|
import { DeleteProfileCommand, } from "./commands/DeleteProfileCommand";
|
|
8
10
|
import { DeletePushTokenCommand, } from "./commands/DeletePushTokenCommand";
|
|
@@ -50,6 +52,8 @@ import { UpgradeUserCommand, } from "./commands/UpgradeUserCommand";
|
|
|
50
52
|
import { ValidateInviteCommand, } from "./commands/ValidateInviteCommand";
|
|
51
53
|
import { createAggregatedClient } from "@smithy/smithy-client";
|
|
52
54
|
const commands = {
|
|
55
|
+
CreateMediaDownloadUrlCommand,
|
|
56
|
+
CreateMediaUploadUrlCommand,
|
|
53
57
|
DeleteMatchMessagesCommand,
|
|
54
58
|
DeletePushTokenCommand,
|
|
55
59
|
GetChatSettingsCommand,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { de_CreateMediaDownloadUrlCommand, se_CreateMediaDownloadUrlCommand, } from "../protocols/Aws_restJson1";
|
|
2
|
+
import { getSerdePlugin } from "@smithy/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
|
+
export { $Command };
|
|
5
|
+
export class CreateMediaDownloadUrlCommand extends $Command.classBuilder()
|
|
6
|
+
.m(function (Command, cs, config, o) {
|
|
7
|
+
return [
|
|
8
|
+
getSerdePlugin(config, this.serialize, this.deserialize),
|
|
9
|
+
];
|
|
10
|
+
})
|
|
11
|
+
.s("OneHookService", "CreateMediaDownloadUrl", {})
|
|
12
|
+
.n("OneHookClient", "CreateMediaDownloadUrlCommand")
|
|
13
|
+
.f(void 0, void 0)
|
|
14
|
+
.ser(se_CreateMediaDownloadUrlCommand)
|
|
15
|
+
.de(de_CreateMediaDownloadUrlCommand)
|
|
16
|
+
.build() {
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { de_CreateMediaUploadUrlCommand, se_CreateMediaUploadUrlCommand, } from "../protocols/Aws_restJson1";
|
|
2
|
+
import { getSerdePlugin } from "@smithy/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
|
+
export { $Command };
|
|
5
|
+
export class CreateMediaUploadUrlCommand extends $Command.classBuilder()
|
|
6
|
+
.m(function (Command, cs, config, o) {
|
|
7
|
+
return [
|
|
8
|
+
getSerdePlugin(config, this.serialize, this.deserialize),
|
|
9
|
+
];
|
|
10
|
+
})
|
|
11
|
+
.s("OneHookService", "CreateMediaUploadUrl", {})
|
|
12
|
+
.n("OneHookClient", "CreateMediaUploadUrlCommand")
|
|
13
|
+
.f(void 0, void 0)
|
|
14
|
+
.ser(se_CreateMediaUploadUrlCommand)
|
|
15
|
+
.de(de_CreateMediaUploadUrlCommand)
|
|
16
|
+
.build() {
|
|
17
|
+
}
|
|
@@ -55,6 +55,12 @@ export class NotFoundError extends __BaseException {
|
|
|
55
55
|
this.error = opts.error;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
+
export const MediaKind = {
|
|
59
|
+
AUDIO: "AUDIO",
|
|
60
|
+
FILE: "FILE",
|
|
61
|
+
IMAGE: "IMAGE",
|
|
62
|
+
VIDEO: "VIDEO",
|
|
63
|
+
};
|
|
58
64
|
export const LastSeenVisibility = {
|
|
59
65
|
EVERYONE: "EVERYONE",
|
|
60
66
|
MATCHES: "MATCHES",
|
|
@@ -3,6 +3,39 @@ import { BadRequestError, DeviceLimitError, ForbiddenError, InternalServerError,
|
|
|
3
3
|
import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
|
|
4
4
|
import { requestBuilder as rb } from "@smithy/core";
|
|
5
5
|
import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, serializeFloat as __serializeFloat, _json, collectBody, map, take, withBaseException, } from "@smithy/smithy-client";
|
|
6
|
+
export const se_CreateMediaDownloadUrlCommand = async (input, context) => {
|
|
7
|
+
const b = rb(input, context);
|
|
8
|
+
const headers = {
|
|
9
|
+
'content-type': 'application/json',
|
|
10
|
+
};
|
|
11
|
+
b.bp("/chat/media/download-url");
|
|
12
|
+
let body;
|
|
13
|
+
body = JSON.stringify(take(input, {
|
|
14
|
+
'matchId': [],
|
|
15
|
+
'objectKey': [],
|
|
16
|
+
}));
|
|
17
|
+
b.m("POST")
|
|
18
|
+
.h(headers)
|
|
19
|
+
.b(body);
|
|
20
|
+
return b.build();
|
|
21
|
+
};
|
|
22
|
+
export const se_CreateMediaUploadUrlCommand = async (input, context) => {
|
|
23
|
+
const b = rb(input, context);
|
|
24
|
+
const headers = {
|
|
25
|
+
'content-type': 'application/json',
|
|
26
|
+
};
|
|
27
|
+
b.bp("/chat/media/upload-url");
|
|
28
|
+
let body;
|
|
29
|
+
body = JSON.stringify(take(input, {
|
|
30
|
+
'contentLength': [],
|
|
31
|
+
'kind': [],
|
|
32
|
+
'matchId': [],
|
|
33
|
+
}));
|
|
34
|
+
b.m("POST")
|
|
35
|
+
.h(headers)
|
|
36
|
+
.b(body);
|
|
37
|
+
return b.build();
|
|
38
|
+
};
|
|
6
39
|
export const se_DeleteMatchMessagesCommand = async (input, context) => {
|
|
7
40
|
const b = rb(input, context);
|
|
8
41
|
const headers = {};
|
|
@@ -736,6 +769,37 @@ export const se_UpgradeUserCommand = async (input, context) => {
|
|
|
736
769
|
.b(body);
|
|
737
770
|
return b.build();
|
|
738
771
|
};
|
|
772
|
+
export const de_CreateMediaDownloadUrlCommand = async (output, context) => {
|
|
773
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
774
|
+
return de_CommandError(output, context);
|
|
775
|
+
}
|
|
776
|
+
const contents = map({
|
|
777
|
+
$metadata: deserializeMetadata(output),
|
|
778
|
+
});
|
|
779
|
+
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
780
|
+
const doc = take(data, {
|
|
781
|
+
'downloadUrl': __expectString,
|
|
782
|
+
'expiresInSeconds': __expectInt32,
|
|
783
|
+
});
|
|
784
|
+
Object.assign(contents, doc);
|
|
785
|
+
return contents;
|
|
786
|
+
};
|
|
787
|
+
export const de_CreateMediaUploadUrlCommand = async (output, context) => {
|
|
788
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
789
|
+
return de_CommandError(output, context);
|
|
790
|
+
}
|
|
791
|
+
const contents = map({
|
|
792
|
+
$metadata: deserializeMetadata(output),
|
|
793
|
+
});
|
|
794
|
+
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
795
|
+
const doc = take(data, {
|
|
796
|
+
'expiresInSeconds': __expectInt32,
|
|
797
|
+
'objectKey': __expectString,
|
|
798
|
+
'uploadUrl': __expectString,
|
|
799
|
+
});
|
|
800
|
+
Object.assign(contents, doc);
|
|
801
|
+
return contents;
|
|
802
|
+
};
|
|
739
803
|
export const de_DeleteMatchMessagesCommand = async (output, context) => {
|
|
740
804
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
741
805
|
return de_CommandError(output, context);
|
package/dist-types/OneHook.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { AuthSocialCommandInput, AuthSocialCommandOutput } from "./commands/Auth
|
|
|
3
3
|
import { CompleteLivenessSessionCommandInput, CompleteLivenessSessionCommandOutput } from "./commands/CompleteLivenessSessionCommand";
|
|
4
4
|
import { CompleteOnboardingCommandInput, CompleteOnboardingCommandOutput } from "./commands/CompleteOnboardingCommand";
|
|
5
5
|
import { CreateLivenessSessionCommandInput, CreateLivenessSessionCommandOutput } from "./commands/CreateLivenessSessionCommand";
|
|
6
|
+
import { CreateMediaDownloadUrlCommandInput, CreateMediaDownloadUrlCommandOutput } from "./commands/CreateMediaDownloadUrlCommand";
|
|
7
|
+
import { CreateMediaUploadUrlCommandInput, CreateMediaUploadUrlCommandOutput } from "./commands/CreateMediaUploadUrlCommand";
|
|
6
8
|
import { DeleteMatchMessagesCommandInput, DeleteMatchMessagesCommandOutput } from "./commands/DeleteMatchMessagesCommand";
|
|
7
9
|
import { DeleteProfileCommandInput, DeleteProfileCommandOutput } from "./commands/DeleteProfileCommand";
|
|
8
10
|
import { DeletePushTokenCommandInput, DeletePushTokenCommandOutput } from "./commands/DeletePushTokenCommand";
|
|
@@ -50,6 +52,18 @@ import { UpgradeUserCommandInput, UpgradeUserCommandOutput } from "./commands/Up
|
|
|
50
52
|
import { ValidateInviteCommandInput, ValidateInviteCommandOutput } from "./commands/ValidateInviteCommand";
|
|
51
53
|
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
|
|
52
54
|
export interface OneHook {
|
|
55
|
+
/**
|
|
56
|
+
* @see {@link CreateMediaDownloadUrlCommand}
|
|
57
|
+
*/
|
|
58
|
+
createMediaDownloadUrl(args: CreateMediaDownloadUrlCommandInput, options?: __HttpHandlerOptions): Promise<CreateMediaDownloadUrlCommandOutput>;
|
|
59
|
+
createMediaDownloadUrl(args: CreateMediaDownloadUrlCommandInput, cb: (err: any, data?: CreateMediaDownloadUrlCommandOutput) => void): void;
|
|
60
|
+
createMediaDownloadUrl(args: CreateMediaDownloadUrlCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: CreateMediaDownloadUrlCommandOutput) => void): void;
|
|
61
|
+
/**
|
|
62
|
+
* @see {@link CreateMediaUploadUrlCommand}
|
|
63
|
+
*/
|
|
64
|
+
createMediaUploadUrl(args: CreateMediaUploadUrlCommandInput, options?: __HttpHandlerOptions): Promise<CreateMediaUploadUrlCommandOutput>;
|
|
65
|
+
createMediaUploadUrl(args: CreateMediaUploadUrlCommandInput, cb: (err: any, data?: CreateMediaUploadUrlCommandOutput) => void): void;
|
|
66
|
+
createMediaUploadUrl(args: CreateMediaUploadUrlCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: CreateMediaUploadUrlCommandOutput) => void): void;
|
|
53
67
|
/**
|
|
54
68
|
* @see {@link DeleteMatchMessagesCommand}
|
|
55
69
|
*/
|
|
@@ -3,6 +3,8 @@ import { AuthSocialCommandInput, AuthSocialCommandOutput } from "./commands/Auth
|
|
|
3
3
|
import { CompleteLivenessSessionCommandInput, CompleteLivenessSessionCommandOutput } from "./commands/CompleteLivenessSessionCommand";
|
|
4
4
|
import { CompleteOnboardingCommandInput, CompleteOnboardingCommandOutput } from "./commands/CompleteOnboardingCommand";
|
|
5
5
|
import { CreateLivenessSessionCommandInput, CreateLivenessSessionCommandOutput } from "./commands/CreateLivenessSessionCommand";
|
|
6
|
+
import { CreateMediaDownloadUrlCommandInput, CreateMediaDownloadUrlCommandOutput } from "./commands/CreateMediaDownloadUrlCommand";
|
|
7
|
+
import { CreateMediaUploadUrlCommandInput, CreateMediaUploadUrlCommandOutput } from "./commands/CreateMediaUploadUrlCommand";
|
|
6
8
|
import { DeleteMatchMessagesCommandInput, DeleteMatchMessagesCommandOutput } from "./commands/DeleteMatchMessagesCommand";
|
|
7
9
|
import { DeleteProfileCommandInput, DeleteProfileCommandOutput } from "./commands/DeleteProfileCommand";
|
|
8
10
|
import { DeletePushTokenCommandInput, DeletePushTokenCommandOutput } from "./commands/DeletePushTokenCommand";
|
|
@@ -60,11 +62,11 @@ export { __Client };
|
|
|
60
62
|
/**
|
|
61
63
|
* @public
|
|
62
64
|
*/
|
|
63
|
-
export type ServiceInputTypes = AuthSocialCommandInput | CompleteLivenessSessionCommandInput | CompleteOnboardingCommandInput | CreateLivenessSessionCommandInput | DeleteMatchMessagesCommandInput | DeleteProfileCommandInput | DeletePushTokenCommandInput | DiscoverCommandInput | GenerateDownloadUrlCommandInput | GenerateInviteCommandInput | GenerateUploadUrlCommandInput | GetChatSettingsCommandInput | GetCredentialReadinessCommandInput | GetLivenessStatusCommandInput | GetMatchCommandInput | GetMyProfileCommandInput | GetNotificationPreferencesCommandInput | GetParticipantRegistryCommandInput | GetPreferencesCommandInput | GetProfileCommandInput | GetStateCommandInput | GetUserByEmailCommandInput | GetUserCommandInput | GetUserIdByUsernameCommandInput | IndexLocationCommandInput | InitUserCommandInput | LinkEmailCommandInput | LinkSocialCommandInput | ListMyDevicesCommandInput | RegisterDeviceCommandInput | RegisterPhoneCommandInput | RegisterPushTokenCommandInput | RemoveLocationCommandInput | RequestEmailOtpCommandInput | RequestPhoneOtpCommandInput | RequestPhoneUpdateOtpCommandInput | RevokeDeviceCommandInput | SwipeByUsernameCommandInput | SwipeCommandInput | UnhookCommandInput | UnlinkSocialCommandInput | UpdateChatSettingsCommandInput | UpdateEntitlementsCommandInput | UpdatePhoneNumberCommandInput | UpdatePreferencesCommandInput | UpdateProfileCommandInput | UpdateUsernameCommandInput | UpgradeUserCommandInput | ValidateInviteCommandInput;
|
|
65
|
+
export type ServiceInputTypes = AuthSocialCommandInput | CompleteLivenessSessionCommandInput | CompleteOnboardingCommandInput | CreateLivenessSessionCommandInput | CreateMediaDownloadUrlCommandInput | CreateMediaUploadUrlCommandInput | DeleteMatchMessagesCommandInput | DeleteProfileCommandInput | DeletePushTokenCommandInput | DiscoverCommandInput | GenerateDownloadUrlCommandInput | GenerateInviteCommandInput | GenerateUploadUrlCommandInput | GetChatSettingsCommandInput | GetCredentialReadinessCommandInput | GetLivenessStatusCommandInput | GetMatchCommandInput | GetMyProfileCommandInput | GetNotificationPreferencesCommandInput | GetParticipantRegistryCommandInput | GetPreferencesCommandInput | GetProfileCommandInput | GetStateCommandInput | GetUserByEmailCommandInput | GetUserCommandInput | GetUserIdByUsernameCommandInput | IndexLocationCommandInput | InitUserCommandInput | LinkEmailCommandInput | LinkSocialCommandInput | ListMyDevicesCommandInput | RegisterDeviceCommandInput | RegisterPhoneCommandInput | RegisterPushTokenCommandInput | RemoveLocationCommandInput | RequestEmailOtpCommandInput | RequestPhoneOtpCommandInput | RequestPhoneUpdateOtpCommandInput | RevokeDeviceCommandInput | SwipeByUsernameCommandInput | SwipeCommandInput | UnhookCommandInput | UnlinkSocialCommandInput | UpdateChatSettingsCommandInput | UpdateEntitlementsCommandInput | UpdatePhoneNumberCommandInput | UpdatePreferencesCommandInput | UpdateProfileCommandInput | UpdateUsernameCommandInput | UpgradeUserCommandInput | ValidateInviteCommandInput;
|
|
64
66
|
/**
|
|
65
67
|
* @public
|
|
66
68
|
*/
|
|
67
|
-
export type ServiceOutputTypes = AuthSocialCommandOutput | CompleteLivenessSessionCommandOutput | CompleteOnboardingCommandOutput | CreateLivenessSessionCommandOutput | DeleteMatchMessagesCommandOutput | DeleteProfileCommandOutput | DeletePushTokenCommandOutput | DiscoverCommandOutput | GenerateDownloadUrlCommandOutput | GenerateInviteCommandOutput | GenerateUploadUrlCommandOutput | GetChatSettingsCommandOutput | GetCredentialReadinessCommandOutput | GetLivenessStatusCommandOutput | GetMatchCommandOutput | GetMyProfileCommandOutput | GetNotificationPreferencesCommandOutput | GetParticipantRegistryCommandOutput | GetPreferencesCommandOutput | GetProfileCommandOutput | GetStateCommandOutput | GetUserByEmailCommandOutput | GetUserCommandOutput | GetUserIdByUsernameCommandOutput | IndexLocationCommandOutput | InitUserCommandOutput | LinkEmailCommandOutput | LinkSocialCommandOutput | ListMyDevicesCommandOutput | RegisterDeviceCommandOutput | RegisterPhoneCommandOutput | RegisterPushTokenCommandOutput | RemoveLocationCommandOutput | RequestEmailOtpCommandOutput | RequestPhoneOtpCommandOutput | RequestPhoneUpdateOtpCommandOutput | RevokeDeviceCommandOutput | SwipeByUsernameCommandOutput | SwipeCommandOutput | UnhookCommandOutput | UnlinkSocialCommandOutput | UpdateChatSettingsCommandOutput | UpdateEntitlementsCommandOutput | UpdatePhoneNumberCommandOutput | UpdatePreferencesCommandOutput | UpdateProfileCommandOutput | UpdateUsernameCommandOutput | UpgradeUserCommandOutput | ValidateInviteCommandOutput;
|
|
69
|
+
export type ServiceOutputTypes = AuthSocialCommandOutput | CompleteLivenessSessionCommandOutput | CompleteOnboardingCommandOutput | CreateLivenessSessionCommandOutput | CreateMediaDownloadUrlCommandOutput | CreateMediaUploadUrlCommandOutput | DeleteMatchMessagesCommandOutput | DeleteProfileCommandOutput | DeletePushTokenCommandOutput | DiscoverCommandOutput | GenerateDownloadUrlCommandOutput | GenerateInviteCommandOutput | GenerateUploadUrlCommandOutput | GetChatSettingsCommandOutput | GetCredentialReadinessCommandOutput | GetLivenessStatusCommandOutput | GetMatchCommandOutput | GetMyProfileCommandOutput | GetNotificationPreferencesCommandOutput | GetParticipantRegistryCommandOutput | GetPreferencesCommandOutput | GetProfileCommandOutput | GetStateCommandOutput | GetUserByEmailCommandOutput | GetUserCommandOutput | GetUserIdByUsernameCommandOutput | IndexLocationCommandOutput | InitUserCommandOutput | LinkEmailCommandOutput | LinkSocialCommandOutput | ListMyDevicesCommandOutput | RegisterDeviceCommandOutput | RegisterPhoneCommandOutput | RegisterPushTokenCommandOutput | RemoveLocationCommandOutput | RequestEmailOtpCommandOutput | RequestPhoneOtpCommandOutput | RequestPhoneUpdateOtpCommandOutput | RevokeDeviceCommandOutput | SwipeByUsernameCommandOutput | SwipeCommandOutput | UnhookCommandOutput | UnlinkSocialCommandOutput | UpdateChatSettingsCommandOutput | UpdateEntitlementsCommandOutput | UpdatePhoneNumberCommandOutput | UpdatePreferencesCommandOutput | UpdateProfileCommandOutput | UpdateUsernameCommandOutput | UpgradeUserCommandOutput | ValidateInviteCommandOutput;
|
|
68
70
|
/**
|
|
69
71
|
* @public
|
|
70
72
|
*/
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../OneHookClient";
|
|
2
|
+
import { CreateMediaDownloadUrlRequest, CreateMediaDownloadUrlResponse } from "../models/models_0";
|
|
3
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
|
+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
|
|
5
|
+
/**
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export type { __MetadataBearer };
|
|
9
|
+
export { $Command };
|
|
10
|
+
/**
|
|
11
|
+
* @public
|
|
12
|
+
*
|
|
13
|
+
* The input for {@link CreateMediaDownloadUrlCommand}.
|
|
14
|
+
*/
|
|
15
|
+
export interface CreateMediaDownloadUrlCommandInput extends CreateMediaDownloadUrlRequest {
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*
|
|
20
|
+
* The output of {@link CreateMediaDownloadUrlCommand}.
|
|
21
|
+
*/
|
|
22
|
+
export interface CreateMediaDownloadUrlCommandOutput extends CreateMediaDownloadUrlResponse, __MetadataBearer {
|
|
23
|
+
}
|
|
24
|
+
declare const CreateMediaDownloadUrlCommand_base: {
|
|
25
|
+
new (input: CreateMediaDownloadUrlCommandInput): import("@smithy/smithy-client").CommandImpl<CreateMediaDownloadUrlCommandInput, CreateMediaDownloadUrlCommandOutput, OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
26
|
+
new (__0_0: CreateMediaDownloadUrlCommandInput): import("@smithy/smithy-client").CommandImpl<CreateMediaDownloadUrlCommandInput, CreateMediaDownloadUrlCommandOutput, OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
27
|
+
getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Issues a presigned URL for downloading ONE encrypted attachment.
|
|
31
|
+
*
|
|
32
|
+
* Returns ciphertext; the caller decrypts with the content key from the message payload. Besides
|
|
33
|
+
* requiring match participation, this REJECTS any `objectKey` not under the caller's own `matchId`
|
|
34
|
+
* prefix — otherwise knowing or guessing a key from another conversation would be enough to read its
|
|
35
|
+
* media.
|
|
36
|
+
* @example
|
|
37
|
+
* Use a bare-bones client and the command you need to make an API call.
|
|
38
|
+
* ```javascript
|
|
39
|
+
* import { OneHookClient, CreateMediaDownloadUrlCommand } from "onehook-api-client"; // ES Modules import
|
|
40
|
+
* // const { OneHookClient, CreateMediaDownloadUrlCommand } = require("onehook-api-client"); // CommonJS import
|
|
41
|
+
* const client = new OneHookClient(config);
|
|
42
|
+
* const input = { // CreateMediaDownloadUrlRequest
|
|
43
|
+
* matchId: "STRING_VALUE", // required
|
|
44
|
+
* objectKey: "STRING_VALUE", // required
|
|
45
|
+
* };
|
|
46
|
+
* const command = new CreateMediaDownloadUrlCommand(input);
|
|
47
|
+
* const response = await client.send(command);
|
|
48
|
+
* // { // CreateMediaDownloadUrlResponse
|
|
49
|
+
* // downloadUrl: "STRING_VALUE", // required
|
|
50
|
+
* // expiresInSeconds: Number("int"), // required
|
|
51
|
+
* // };
|
|
52
|
+
*
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @param CreateMediaDownloadUrlCommandInput - {@link CreateMediaDownloadUrlCommandInput}
|
|
56
|
+
* @returns {@link CreateMediaDownloadUrlCommandOutput}
|
|
57
|
+
* @see {@link CreateMediaDownloadUrlCommandInput} for command's `input` shape.
|
|
58
|
+
* @see {@link CreateMediaDownloadUrlCommandOutput} for command's `response` shape.
|
|
59
|
+
* @see {@link OneHookClientResolvedConfig | config} for OneHookClient's `config` shape.
|
|
60
|
+
*
|
|
61
|
+
* @throws {@link BadRequestError} (client fault)
|
|
62
|
+
*
|
|
63
|
+
* @throws {@link ForbiddenError} (client fault)
|
|
64
|
+
*
|
|
65
|
+
* @throws {@link NotFoundError} (client fault)
|
|
66
|
+
*
|
|
67
|
+
* @throws {@link InternalServerError} (server fault)
|
|
68
|
+
*
|
|
69
|
+
* @throws {@link OneHookServiceException}
|
|
70
|
+
* <p>Base exception class for all service exceptions from OneHook service.</p>
|
|
71
|
+
*
|
|
72
|
+
*
|
|
73
|
+
* @public
|
|
74
|
+
*/
|
|
75
|
+
export declare class CreateMediaDownloadUrlCommand extends CreateMediaDownloadUrlCommand_base {
|
|
76
|
+
/** @internal type navigation helper, not in runtime. */
|
|
77
|
+
protected static __types: {
|
|
78
|
+
api: {
|
|
79
|
+
input: CreateMediaDownloadUrlRequest;
|
|
80
|
+
output: CreateMediaDownloadUrlResponse;
|
|
81
|
+
};
|
|
82
|
+
sdk: {
|
|
83
|
+
input: CreateMediaDownloadUrlCommandInput;
|
|
84
|
+
output: CreateMediaDownloadUrlCommandOutput;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../OneHookClient";
|
|
2
|
+
import { CreateMediaUploadUrlRequest, CreateMediaUploadUrlResponse } from "../models/models_0";
|
|
3
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
|
+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
|
|
5
|
+
/**
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export type { __MetadataBearer };
|
|
9
|
+
export { $Command };
|
|
10
|
+
/**
|
|
11
|
+
* @public
|
|
12
|
+
*
|
|
13
|
+
* The input for {@link CreateMediaUploadUrlCommand}.
|
|
14
|
+
*/
|
|
15
|
+
export interface CreateMediaUploadUrlCommandInput extends CreateMediaUploadUrlRequest {
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*
|
|
20
|
+
* The output of {@link CreateMediaUploadUrlCommand}.
|
|
21
|
+
*/
|
|
22
|
+
export interface CreateMediaUploadUrlCommandOutput extends CreateMediaUploadUrlResponse, __MetadataBearer {
|
|
23
|
+
}
|
|
24
|
+
declare const CreateMediaUploadUrlCommand_base: {
|
|
25
|
+
new (input: CreateMediaUploadUrlCommandInput): import("@smithy/smithy-client").CommandImpl<CreateMediaUploadUrlCommandInput, CreateMediaUploadUrlCommandOutput, OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
26
|
+
new (__0_0: CreateMediaUploadUrlCommandInput): import("@smithy/smithy-client").CommandImpl<CreateMediaUploadUrlCommandInput, CreateMediaUploadUrlCommandOutput, OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
27
|
+
getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Issues a presigned URL for uploading ONE encrypted attachment.
|
|
31
|
+
*
|
|
32
|
+
* The client encrypts the file locally with a per-attachment AES-256-GCM key and uploads only the
|
|
33
|
+
* ciphertext, so the object this URL writes is unreadable by the service. That key travels to the
|
|
34
|
+
* recipient inside the E2EE message payload and is never sent here.
|
|
35
|
+
*
|
|
36
|
+
* Authorized by match participation, so an upload URL cannot be obtained for a conversation the
|
|
37
|
+
* caller is not in. The URL is signed for EXACTLY `contentLength` bytes, so it cannot be replayed to
|
|
38
|
+
* store something larger than was authorized.
|
|
39
|
+
* @example
|
|
40
|
+
* Use a bare-bones client and the command you need to make an API call.
|
|
41
|
+
* ```javascript
|
|
42
|
+
* import { OneHookClient, CreateMediaUploadUrlCommand } from "onehook-api-client"; // ES Modules import
|
|
43
|
+
* // const { OneHookClient, CreateMediaUploadUrlCommand } = require("onehook-api-client"); // CommonJS import
|
|
44
|
+
* const client = new OneHookClient(config);
|
|
45
|
+
* const input = { // CreateMediaUploadUrlRequest
|
|
46
|
+
* matchId: "STRING_VALUE", // required
|
|
47
|
+
* contentLength: Number("long"), // required
|
|
48
|
+
* kind: "IMAGE" || "VIDEO" || "AUDIO" || "FILE", // required
|
|
49
|
+
* };
|
|
50
|
+
* const command = new CreateMediaUploadUrlCommand(input);
|
|
51
|
+
* const response = await client.send(command);
|
|
52
|
+
* // { // CreateMediaUploadUrlResponse
|
|
53
|
+
* // objectKey: "STRING_VALUE", // required
|
|
54
|
+
* // uploadUrl: "STRING_VALUE", // required
|
|
55
|
+
* // expiresInSeconds: Number("int"), // required
|
|
56
|
+
* // };
|
|
57
|
+
*
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* @param CreateMediaUploadUrlCommandInput - {@link CreateMediaUploadUrlCommandInput}
|
|
61
|
+
* @returns {@link CreateMediaUploadUrlCommandOutput}
|
|
62
|
+
* @see {@link CreateMediaUploadUrlCommandInput} for command's `input` shape.
|
|
63
|
+
* @see {@link CreateMediaUploadUrlCommandOutput} for command's `response` shape.
|
|
64
|
+
* @see {@link OneHookClientResolvedConfig | config} for OneHookClient's `config` shape.
|
|
65
|
+
*
|
|
66
|
+
* @throws {@link BadRequestError} (client fault)
|
|
67
|
+
*
|
|
68
|
+
* @throws {@link ForbiddenError} (client fault)
|
|
69
|
+
*
|
|
70
|
+
* @throws {@link NotFoundError} (client fault)
|
|
71
|
+
*
|
|
72
|
+
* @throws {@link InternalServerError} (server fault)
|
|
73
|
+
*
|
|
74
|
+
* @throws {@link OneHookServiceException}
|
|
75
|
+
* <p>Base exception class for all service exceptions from OneHook service.</p>
|
|
76
|
+
*
|
|
77
|
+
*
|
|
78
|
+
* @public
|
|
79
|
+
*/
|
|
80
|
+
export declare class CreateMediaUploadUrlCommand extends CreateMediaUploadUrlCommand_base {
|
|
81
|
+
/** @internal type navigation helper, not in runtime. */
|
|
82
|
+
protected static __types: {
|
|
83
|
+
api: {
|
|
84
|
+
input: CreateMediaUploadUrlRequest;
|
|
85
|
+
output: CreateMediaUploadUrlResponse;
|
|
86
|
+
};
|
|
87
|
+
sdk: {
|
|
88
|
+
input: CreateMediaUploadUrlCommandInput;
|
|
89
|
+
output: CreateMediaUploadUrlCommandOutput;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
}
|
|
@@ -3,14 +3,24 @@ import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-cli
|
|
|
3
3
|
/**
|
|
4
4
|
* @public
|
|
5
5
|
*/
|
|
6
|
-
export interface
|
|
6
|
+
export interface CreateMediaDownloadUrlRequest {
|
|
7
7
|
matchId: string | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* Must be under `<matchId>/`; anything else is rejected as forbidden.
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
objectKey: string | undefined;
|
|
8
13
|
}
|
|
9
14
|
/**
|
|
10
15
|
* @public
|
|
11
16
|
*/
|
|
12
|
-
export interface
|
|
13
|
-
|
|
17
|
+
export interface CreateMediaDownloadUrlResponse {
|
|
18
|
+
/**
|
|
19
|
+
* Presigned GET returning ciphertext.
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
downloadUrl: string | undefined;
|
|
23
|
+
expiresInSeconds: number | undefined;
|
|
14
24
|
}
|
|
15
25
|
/**
|
|
16
26
|
* @public
|
|
@@ -48,6 +58,85 @@ export declare class InternalServerError extends __BaseException {
|
|
|
48
58
|
*/
|
|
49
59
|
constructor(opts: __ExceptionOptionType<InternalServerError, __BaseException>);
|
|
50
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
export declare class NotFoundError extends __BaseException {
|
|
65
|
+
readonly name: "NotFoundError";
|
|
66
|
+
readonly $fault: "client";
|
|
67
|
+
error: string | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
constructor(opts: __ExceptionOptionType<NotFoundError, __BaseException>);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* @public
|
|
75
|
+
* @enum
|
|
76
|
+
*/
|
|
77
|
+
export declare const MediaKind: {
|
|
78
|
+
readonly AUDIO: "AUDIO";
|
|
79
|
+
readonly FILE: "FILE";
|
|
80
|
+
readonly IMAGE: "IMAGE";
|
|
81
|
+
readonly VIDEO: "VIDEO";
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* @public
|
|
85
|
+
*/
|
|
86
|
+
export type MediaKind = typeof MediaKind[keyof typeof MediaKind];
|
|
87
|
+
/**
|
|
88
|
+
* @public
|
|
89
|
+
*/
|
|
90
|
+
export interface CreateMediaUploadUrlRequest {
|
|
91
|
+
/**
|
|
92
|
+
* Conversation the attachment belongs to. The caller must be a participant.
|
|
93
|
+
* @public
|
|
94
|
+
*/
|
|
95
|
+
matchId: string | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* Byte length of the CIPHERTEXT to upload, which the presigned URL is bound to.
|
|
98
|
+
*
|
|
99
|
+
* 100 MiB plus an allowance for the AES-GCM tag. A hard cap here is what stops a participant from
|
|
100
|
+
* parking arbitrary amounts of data in the bucket.
|
|
101
|
+
* @public
|
|
102
|
+
*/
|
|
103
|
+
contentLength: number | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* Kind of attachment. Carried so the service can apply per-kind limits; the authoritative kind used
|
|
106
|
+
* for rendering lives in the encrypted payload, where the service cannot see it.
|
|
107
|
+
* @public
|
|
108
|
+
*/
|
|
109
|
+
kind: MediaKind | undefined;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* @public
|
|
113
|
+
*/
|
|
114
|
+
export interface CreateMediaUploadUrlResponse {
|
|
115
|
+
/**
|
|
116
|
+
* `<matchId>/<uuid>`. The client puts this in the encrypted envelope so the recipient can fetch
|
|
117
|
+
* it; the matchId prefix is what makes prefix deletion on HookReleased possible.
|
|
118
|
+
* @public
|
|
119
|
+
*/
|
|
120
|
+
objectKey: string | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* Presigned PUT, valid only for the requested byte length.
|
|
123
|
+
* @public
|
|
124
|
+
*/
|
|
125
|
+
uploadUrl: string | undefined;
|
|
126
|
+
expiresInSeconds: number | undefined;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* @public
|
|
130
|
+
*/
|
|
131
|
+
export interface DeleteMatchMessagesRequest {
|
|
132
|
+
matchId: string | undefined;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* @public
|
|
136
|
+
*/
|
|
137
|
+
export interface DeleteMatchMessagesResponse {
|
|
138
|
+
deleted: number | undefined;
|
|
139
|
+
}
|
|
51
140
|
/**
|
|
52
141
|
* @public
|
|
53
142
|
*/
|
|
@@ -74,18 +163,6 @@ export interface DeletePushTokenResponse {
|
|
|
74
163
|
*/
|
|
75
164
|
deleted: boolean | undefined;
|
|
76
165
|
}
|
|
77
|
-
/**
|
|
78
|
-
* @public
|
|
79
|
-
*/
|
|
80
|
-
export declare class NotFoundError extends __BaseException {
|
|
81
|
-
readonly name: "NotFoundError";
|
|
82
|
-
readonly $fault: "client";
|
|
83
|
-
error: string | undefined;
|
|
84
|
-
/**
|
|
85
|
-
* @internal
|
|
86
|
-
*/
|
|
87
|
-
constructor(opts: __ExceptionOptionType<NotFoundError, __BaseException>);
|
|
88
|
-
}
|
|
89
166
|
/**
|
|
90
167
|
* @public
|
|
91
168
|
*/
|
|
@@ -2,6 +2,8 @@ import { AuthSocialCommandInput, AuthSocialCommandOutput } from "../commands/Aut
|
|
|
2
2
|
import { CompleteLivenessSessionCommandInput, CompleteLivenessSessionCommandOutput } from "../commands/CompleteLivenessSessionCommand";
|
|
3
3
|
import { CompleteOnboardingCommandInput, CompleteOnboardingCommandOutput } from "../commands/CompleteOnboardingCommand";
|
|
4
4
|
import { CreateLivenessSessionCommandInput, CreateLivenessSessionCommandOutput } from "../commands/CreateLivenessSessionCommand";
|
|
5
|
+
import { CreateMediaDownloadUrlCommandInput, CreateMediaDownloadUrlCommandOutput } from "../commands/CreateMediaDownloadUrlCommand";
|
|
6
|
+
import { CreateMediaUploadUrlCommandInput, CreateMediaUploadUrlCommandOutput } from "../commands/CreateMediaUploadUrlCommand";
|
|
5
7
|
import { DeleteMatchMessagesCommandInput, DeleteMatchMessagesCommandOutput } from "../commands/DeleteMatchMessagesCommand";
|
|
6
8
|
import { DeleteProfileCommandInput, DeleteProfileCommandOutput } from "../commands/DeleteProfileCommand";
|
|
7
9
|
import { DeletePushTokenCommandInput, DeletePushTokenCommandOutput } from "../commands/DeletePushTokenCommand";
|
|
@@ -49,6 +51,14 @@ import { UpgradeUserCommandInput, UpgradeUserCommandOutput } from "../commands/U
|
|
|
49
51
|
import { ValidateInviteCommandInput, ValidateInviteCommandOutput } from "../commands/ValidateInviteCommand";
|
|
50
52
|
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
|
|
51
53
|
import { SerdeContext as __SerdeContext } from "@smithy/types";
|
|
54
|
+
/**
|
|
55
|
+
* serializeAws_restJson1CreateMediaDownloadUrlCommand
|
|
56
|
+
*/
|
|
57
|
+
export declare const se_CreateMediaDownloadUrlCommand: (input: CreateMediaDownloadUrlCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
|
|
58
|
+
/**
|
|
59
|
+
* serializeAws_restJson1CreateMediaUploadUrlCommand
|
|
60
|
+
*/
|
|
61
|
+
export declare const se_CreateMediaUploadUrlCommand: (input: CreateMediaUploadUrlCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
|
|
52
62
|
/**
|
|
53
63
|
* serializeAws_restJson1DeleteMatchMessagesCommand
|
|
54
64
|
*/
|
|
@@ -245,6 +255,14 @@ export declare const se_UnhookCommand: (input: UnhookCommandInput, context: __Se
|
|
|
245
255
|
* serializeAws_restJson1UpgradeUserCommand
|
|
246
256
|
*/
|
|
247
257
|
export declare const se_UpgradeUserCommand: (input: UpgradeUserCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
|
|
258
|
+
/**
|
|
259
|
+
* deserializeAws_restJson1CreateMediaDownloadUrlCommand
|
|
260
|
+
*/
|
|
261
|
+
export declare const de_CreateMediaDownloadUrlCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<CreateMediaDownloadUrlCommandOutput>;
|
|
262
|
+
/**
|
|
263
|
+
* deserializeAws_restJson1CreateMediaUploadUrlCommand
|
|
264
|
+
*/
|
|
265
|
+
export declare const de_CreateMediaUploadUrlCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<CreateMediaUploadUrlCommandOutput>;
|
|
248
266
|
/**
|
|
249
267
|
* deserializeAws_restJson1DeleteMatchMessagesCommand
|
|
250
268
|
*/
|
package/package.json
CHANGED