onehook-api-client 1.0.6 → 1.0.8

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.
Files changed (33) hide show
  1. package/README.md +27 -13
  2. package/dist-cjs/OneHook.js +8 -4
  3. package/dist-cjs/commands/GetParticipantRegistryCommand.js +21 -0
  4. package/dist-cjs/commands/{UploadPreKeysCommand.js → ListMyDevicesCommand.js} +7 -7
  5. package/dist-cjs/commands/{ClaimPreKeyBundleCommand.js → RegisterDeviceCommand.js} +7 -7
  6. package/dist-cjs/commands/RevokeDeviceCommand.js +21 -0
  7. package/dist-cjs/commands/index.js +4 -2
  8. package/dist-cjs/graphql/types.js +8 -1
  9. package/dist-cjs/models/models_0.js +21 -1
  10. package/dist-cjs/protocols/Aws_restJson1.js +104 -28
  11. package/dist-es/OneHook.js +8 -4
  12. package/dist-es/commands/GetParticipantRegistryCommand.js +17 -0
  13. package/dist-es/commands/{UploadPreKeysCommand.js → ListMyDevicesCommand.js} +6 -6
  14. package/dist-es/commands/RegisterDeviceCommand.js +17 -0
  15. package/dist-es/commands/RevokeDeviceCommand.js +17 -0
  16. package/dist-es/commands/index.js +4 -2
  17. package/dist-es/graphql/types.js +7 -0
  18. package/dist-es/models/models_0.js +19 -0
  19. package/dist-es/protocols/Aws_restJson1.js +93 -21
  20. package/dist-types/OneHook.d.ts +27 -12
  21. package/dist-types/OneHookClient.d.ts +6 -4
  22. package/dist-types/commands/GetParticipantRegistryCommand.d.ts +98 -0
  23. package/dist-types/commands/ListMyDevicesCommand.d.ts +89 -0
  24. package/dist-types/commands/RegisterDeviceCommand.d.ts +112 -0
  25. package/dist-types/commands/RevokeDeviceCommand.d.ts +81 -0
  26. package/dist-types/commands/index.d.ts +4 -2
  27. package/dist-types/graphql/types.d.ts +51 -0
  28. package/dist-types/models/models_0.d.ts +188 -24
  29. package/dist-types/protocols/Aws_restJson1.d.ts +32 -14
  30. package/package.json +1 -1
  31. package/dist-es/commands/ClaimPreKeyBundleCommand.js +0 -17
  32. package/dist-types/commands/ClaimPreKeyBundleCommand.d.ts +0 -88
  33. package/dist-types/commands/UploadPreKeysCommand.d.ts +0 -82
package/README.md CHANGED
@@ -19,16 +19,16 @@ using your favorite package manager:
19
19
 
20
20
  The AWS SDK is modulized by clients and commands.
21
21
  To send a request, you only need to import the `OneHookClient` and
22
- the commands you need, for example `GetUserCommand`:
22
+ the commands you need, for example `ListMyDevicesCommand`:
23
23
 
24
24
  ```js
25
25
  // ES5 example
26
- const { OneHookClient, GetUserCommand } = require("onehook-api-client");
26
+ const { OneHookClient, ListMyDevicesCommand } = require("onehook-api-client");
27
27
  ```
28
28
 
29
29
  ```ts
30
30
  // ES6+ example
31
- import { OneHookClient, GetUserCommand } from "onehook-api-client";
31
+ import { OneHookClient, ListMyDevicesCommand } from "onehook-api-client";
32
32
  ```
33
33
 
34
34
  ### Usage
@@ -45,7 +45,7 @@ To send a request, you:
45
45
  const client = new OneHookClient({ region: "REGION" });
46
46
 
47
47
  const params = { /** input parameters */ };
48
- const command = new GetUserCommand(params);
48
+ const command = new ListMyDevicesCommand(params);
49
49
  ```
50
50
 
51
51
  #### Async/await
@@ -124,7 +124,7 @@ const client = new AWS.OneHook({ region: "REGION" });
124
124
 
125
125
  // async/await.
126
126
  try {
127
- const data = await client.getUser(params);
127
+ const data = await client.listMyDevices(params);
128
128
  // process data.
129
129
  } catch (error) {
130
130
  // error handling.
@@ -132,7 +132,7 @@ try {
132
132
 
133
133
  // Promises.
134
134
  client
135
- .getUser(params)
135
+ .listMyDevices(params)
136
136
  .then((data) => {
137
137
  // process data.
138
138
  })
@@ -141,7 +141,7 @@ client
141
141
  });
142
142
 
143
143
  // callbacks.
144
- client.getUser(params, (err, data) => {
144
+ client.listMyDevices(params, (err, data) => {
145
145
  // process err and data.
146
146
  });
147
147
  ```
@@ -199,24 +199,38 @@ see LICENSE for more information.
199
199
 
200
200
  <details>
201
201
  <summary>
202
- ClaimPreKeyBundle
202
+ DeleteMatchMessages
203
203
  </summary>
204
204
 
205
- [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/onehook/command/ClaimPreKeyBundleCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-onehook/Interface/ClaimPreKeyBundleCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-onehook/Interface/ClaimPreKeyBundleCommandOutput/)
205
+ [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/onehook/command/DeleteMatchMessagesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-onehook/Interface/DeleteMatchMessagesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-onehook/Interface/DeleteMatchMessagesCommandOutput/)
206
206
  </details>
207
207
  <details>
208
208
  <summary>
209
- DeleteMatchMessages
209
+ GetParticipantRegistry
210
210
  </summary>
211
211
 
212
- [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/onehook/command/DeleteMatchMessagesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-onehook/Interface/DeleteMatchMessagesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-onehook/Interface/DeleteMatchMessagesCommandOutput/)
212
+ [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/onehook/command/GetParticipantRegistryCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-onehook/Interface/GetParticipantRegistryCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-onehook/Interface/GetParticipantRegistryCommandOutput/)
213
+ </details>
214
+ <details>
215
+ <summary>
216
+ ListMyDevices
217
+ </summary>
218
+
219
+ [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/onehook/command/ListMyDevicesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-onehook/Interface/ListMyDevicesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-onehook/Interface/ListMyDevicesCommandOutput/)
220
+ </details>
221
+ <details>
222
+ <summary>
223
+ RegisterDevice
224
+ </summary>
225
+
226
+ [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/onehook/command/RegisterDeviceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-onehook/Interface/RegisterDeviceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-onehook/Interface/RegisterDeviceCommandOutput/)
213
227
  </details>
214
228
  <details>
215
229
  <summary>
216
- UploadPreKeys
230
+ RevokeDevice
217
231
  </summary>
218
232
 
219
- [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/onehook/command/UploadPreKeysCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-onehook/Interface/UploadPreKeysCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-onehook/Interface/UploadPreKeysCommandOutput/)
233
+ [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/onehook/command/RevokeDeviceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-onehook/Interface/RevokeDeviceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-onehook/Interface/RevokeDeviceCommandOutput/)
220
234
  </details>
221
235
  <details>
222
236
  <summary>
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OneHook = void 0;
4
4
  const OneHookClient_1 = require("./OneHookClient");
5
5
  const AuthSocialCommand_1 = require("./commands/AuthSocialCommand");
6
- const ClaimPreKeyBundleCommand_1 = require("./commands/ClaimPreKeyBundleCommand");
7
6
  const CompleteLivenessSessionCommand_1 = require("./commands/CompleteLivenessSessionCommand");
8
7
  const CompleteOnboardingCommand_1 = require("./commands/CompleteOnboardingCommand");
9
8
  const CreateLivenessSessionCommand_1 = require("./commands/CreateLivenessSessionCommand");
@@ -16,6 +15,7 @@ const GenerateUploadUrlCommand_1 = require("./commands/GenerateUploadUrlCommand"
16
15
  const GetLivenessStatusCommand_1 = require("./commands/GetLivenessStatusCommand");
17
16
  const GetMatchCommand_1 = require("./commands/GetMatchCommand");
18
17
  const GetMyProfileCommand_1 = require("./commands/GetMyProfileCommand");
18
+ const GetParticipantRegistryCommand_1 = require("./commands/GetParticipantRegistryCommand");
19
19
  const GetPreferencesCommand_1 = require("./commands/GetPreferencesCommand");
20
20
  const GetProfileCommand_1 = require("./commands/GetProfileCommand");
21
21
  const GetStateCommand_1 = require("./commands/GetStateCommand");
@@ -25,11 +25,14 @@ const IndexLocationCommand_1 = require("./commands/IndexLocationCommand");
25
25
  const InitUserCommand_1 = require("./commands/InitUserCommand");
26
26
  const LinkEmailCommand_1 = require("./commands/LinkEmailCommand");
27
27
  const LinkSocialCommand_1 = require("./commands/LinkSocialCommand");
28
+ const ListMyDevicesCommand_1 = require("./commands/ListMyDevicesCommand");
29
+ const RegisterDeviceCommand_1 = require("./commands/RegisterDeviceCommand");
28
30
  const RegisterPhoneCommand_1 = require("./commands/RegisterPhoneCommand");
29
31
  const RemoveLocationCommand_1 = require("./commands/RemoveLocationCommand");
30
32
  const RequestEmailOtpCommand_1 = require("./commands/RequestEmailOtpCommand");
31
33
  const RequestPhoneOtpCommand_1 = require("./commands/RequestPhoneOtpCommand");
32
34
  const RequestPhoneUpdateOtpCommand_1 = require("./commands/RequestPhoneUpdateOtpCommand");
35
+ const RevokeDeviceCommand_1 = require("./commands/RevokeDeviceCommand");
33
36
  const SwipeCommand_1 = require("./commands/SwipeCommand");
34
37
  const UnhookCommand_1 = require("./commands/UnhookCommand");
35
38
  const UnlinkSocialCommand_1 = require("./commands/UnlinkSocialCommand");
@@ -38,13 +41,14 @@ const UpdatePhoneNumberCommand_1 = require("./commands/UpdatePhoneNumberCommand"
38
41
  const UpdatePreferencesCommand_1 = require("./commands/UpdatePreferencesCommand");
39
42
  const UpdateProfileCommand_1 = require("./commands/UpdateProfileCommand");
40
43
  const UpgradeUserCommand_1 = require("./commands/UpgradeUserCommand");
41
- const UploadPreKeysCommand_1 = require("./commands/UploadPreKeysCommand");
42
44
  const ValidateInviteCommand_1 = require("./commands/ValidateInviteCommand");
43
45
  const smithy_client_1 = require("@smithy/smithy-client");
44
46
  const commands = {
45
- ClaimPreKeyBundleCommand: ClaimPreKeyBundleCommand_1.ClaimPreKeyBundleCommand,
46
47
  DeleteMatchMessagesCommand: DeleteMatchMessagesCommand_1.DeleteMatchMessagesCommand,
47
- UploadPreKeysCommand: UploadPreKeysCommand_1.UploadPreKeysCommand,
48
+ GetParticipantRegistryCommand: GetParticipantRegistryCommand_1.GetParticipantRegistryCommand,
49
+ ListMyDevicesCommand: ListMyDevicesCommand_1.ListMyDevicesCommand,
50
+ RegisterDeviceCommand: RegisterDeviceCommand_1.RegisterDeviceCommand,
51
+ RevokeDeviceCommand: RevokeDeviceCommand_1.RevokeDeviceCommand,
48
52
  AuthSocialCommand: AuthSocialCommand_1.AuthSocialCommand,
49
53
  GenerateInviteCommand: GenerateInviteCommand_1.GenerateInviteCommand,
50
54
  GetUserCommand: GetUserCommand_1.GetUserCommand,
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetParticipantRegistryCommand = 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 GetParticipantRegistryCommand 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", "GetParticipantRegistry", {})
15
+ .n("OneHookClient", "GetParticipantRegistryCommand")
16
+ .f(void 0, void 0)
17
+ .ser(Aws_restJson1_1.se_GetParticipantRegistryCommand)
18
+ .de(Aws_restJson1_1.de_GetParticipantRegistryCommand)
19
+ .build() {
20
+ }
21
+ exports.GetParticipantRegistryCommand = GetParticipantRegistryCommand;
@@ -1,21 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UploadPreKeysCommand = exports.$Command = void 0;
3
+ exports.ListMyDevicesCommand = exports.$Command = void 0;
4
4
  const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
5
5
  const middleware_serde_1 = require("@smithy/middleware-serde");
6
6
  const smithy_client_1 = require("@smithy/smithy-client");
7
7
  Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
- class UploadPreKeysCommand extends smithy_client_1.Command.classBuilder()
8
+ class ListMyDevicesCommand extends smithy_client_1.Command.classBuilder()
9
9
  .m(function (Command, cs, config, o) {
10
10
  return [
11
11
  (0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
12
12
  ];
13
13
  })
14
- .s("OneHookService", "UploadPreKeys", {})
15
- .n("OneHookClient", "UploadPreKeysCommand")
14
+ .s("OneHookService", "ListMyDevices", {})
15
+ .n("OneHookClient", "ListMyDevicesCommand")
16
16
  .f(void 0, void 0)
17
- .ser(Aws_restJson1_1.se_UploadPreKeysCommand)
18
- .de(Aws_restJson1_1.de_UploadPreKeysCommand)
17
+ .ser(Aws_restJson1_1.se_ListMyDevicesCommand)
18
+ .de(Aws_restJson1_1.de_ListMyDevicesCommand)
19
19
  .build() {
20
20
  }
21
- exports.UploadPreKeysCommand = UploadPreKeysCommand;
21
+ exports.ListMyDevicesCommand = ListMyDevicesCommand;
@@ -1,21 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ClaimPreKeyBundleCommand = exports.$Command = void 0;
3
+ exports.RegisterDeviceCommand = exports.$Command = void 0;
4
4
  const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
5
5
  const middleware_serde_1 = require("@smithy/middleware-serde");
6
6
  const smithy_client_1 = require("@smithy/smithy-client");
7
7
  Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
- class ClaimPreKeyBundleCommand extends smithy_client_1.Command.classBuilder()
8
+ class RegisterDeviceCommand extends smithy_client_1.Command.classBuilder()
9
9
  .m(function (Command, cs, config, o) {
10
10
  return [
11
11
  (0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
12
12
  ];
13
13
  })
14
- .s("OneHookService", "ClaimPreKeyBundle", {})
15
- .n("OneHookClient", "ClaimPreKeyBundleCommand")
14
+ .s("OneHookService", "RegisterDevice", {})
15
+ .n("OneHookClient", "RegisterDeviceCommand")
16
16
  .f(void 0, void 0)
17
- .ser(Aws_restJson1_1.se_ClaimPreKeyBundleCommand)
18
- .de(Aws_restJson1_1.de_ClaimPreKeyBundleCommand)
17
+ .ser(Aws_restJson1_1.se_RegisterDeviceCommand)
18
+ .de(Aws_restJson1_1.de_RegisterDeviceCommand)
19
19
  .build() {
20
20
  }
21
- exports.ClaimPreKeyBundleCommand = ClaimPreKeyBundleCommand;
21
+ exports.RegisterDeviceCommand = RegisterDeviceCommand;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RevokeDeviceCommand = 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 RevokeDeviceCommand 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", "RevokeDevice", {})
15
+ .n("OneHookClient", "RevokeDeviceCommand")
16
+ .f(void 0, void 0)
17
+ .ser(Aws_restJson1_1.se_RevokeDeviceCommand)
18
+ .de(Aws_restJson1_1.de_RevokeDeviceCommand)
19
+ .build() {
20
+ }
21
+ exports.RevokeDeviceCommand = RevokeDeviceCommand;
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./ClaimPreKeyBundleCommand"), exports);
5
4
  tslib_1.__exportStar(require("./DeleteMatchMessagesCommand"), exports);
6
- tslib_1.__exportStar(require("./UploadPreKeysCommand"), exports);
5
+ tslib_1.__exportStar(require("./GetParticipantRegistryCommand"), exports);
6
+ tslib_1.__exportStar(require("./ListMyDevicesCommand"), exports);
7
+ tslib_1.__exportStar(require("./RegisterDeviceCommand"), exports);
8
+ tslib_1.__exportStar(require("./RevokeDeviceCommand"), exports);
7
9
  tslib_1.__exportStar(require("./AuthSocialCommand"), exports);
8
10
  tslib_1.__exportStar(require("./GenerateInviteCommand"), exports);
9
11
  tslib_1.__exportStar(require("./GetUserCommand"), exports);
@@ -1,6 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MessageStatus = void 0;
3
+ exports.MessageStatus = exports.KeyRecoveryStatus = void 0;
4
+ var KeyRecoveryStatus;
5
+ (function (KeyRecoveryStatus) {
6
+ KeyRecoveryStatus["Completed"] = "COMPLETED";
7
+ KeyRecoveryStatus["Declined"] = "DECLINED";
8
+ KeyRecoveryStatus["Displaying"] = "DISPLAYING";
9
+ KeyRecoveryStatus["Pending"] = "PENDING";
10
+ })(KeyRecoveryStatus || (exports.KeyRecoveryStatus = KeyRecoveryStatus = {}));
4
11
  var MessageStatus;
5
12
  (function (MessageStatus) {
6
13
  MessageStatus["Delivered"] = "DELIVERED";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NotFoundError = exports.InternalServerError = exports.BadRequestError = exports.ForbiddenError = void 0;
3
+ exports.DeviceLimitError = exports.NotFoundError = exports.Platform = 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";
@@ -47,6 +47,11 @@ class InternalServerError extends OneHookServiceException_1.OneHookServiceExcept
47
47
  }
48
48
  }
49
49
  exports.InternalServerError = InternalServerError;
50
+ exports.Platform = {
51
+ ANDROID: "ANDROID",
52
+ IOS: "IOS",
53
+ WEB: "WEB",
54
+ };
50
55
  class NotFoundError extends OneHookServiceException_1.OneHookServiceException {
51
56
  name = "NotFoundError";
52
57
  $fault = "client";
@@ -62,3 +67,18 @@ class NotFoundError extends OneHookServiceException_1.OneHookServiceException {
62
67
  }
63
68
  }
64
69
  exports.NotFoundError = NotFoundError;
70
+ class DeviceLimitError extends OneHookServiceException_1.OneHookServiceException {
71
+ name = "DeviceLimitError";
72
+ $fault = "client";
73
+ error;
74
+ constructor(opts) {
75
+ super({
76
+ name: "DeviceLimitError",
77
+ $fault: "client",
78
+ ...opts
79
+ });
80
+ Object.setPrototypeOf(this, DeviceLimitError.prototype);
81
+ this.error = opts.error;
82
+ }
83
+ }
84
+ exports.DeviceLimitError = DeviceLimitError;
@@ -1,58 +1,84 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_RequestPhoneOtpCommand = exports.de_RequestEmailOtpCommand = exports.de_RegisterPhoneCommand = exports.de_LinkSocialCommand = exports.de_LinkEmailCommand = exports.de_GetUserByEmailCommand = exports.de_GetUserCommand = exports.de_GenerateInviteCommand = exports.de_AuthSocialCommand = exports.de_UploadPreKeysCommand = exports.de_DeleteMatchMessagesCommand = exports.de_ClaimPreKeyBundleCommand = exports.se_UpgradeUserCommand = 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_SwipeCommand = exports.se_RemoveLocationCommand = exports.se_IndexLocationCommand = exports.se_GetPreferencesCommand = exports.se_DiscoverCommand = exports.se_ValidateInviteCommand = 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_GetUserByEmailCommand = exports.se_GetUserCommand = exports.se_GenerateInviteCommand = exports.se_AuthSocialCommand = exports.se_UploadPreKeysCommand = exports.se_DeleteMatchMessagesCommand = exports.se_ClaimPreKeyBundleCommand = void 0;
4
- exports.de_UpgradeUserCommand = exports.de_UnhookCommand = 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_SwipeCommand = exports.de_RemoveLocationCommand = exports.de_IndexLocationCommand = exports.de_GetPreferencesCommand = exports.de_DiscoverCommand = exports.de_ValidateInviteCommand = exports.de_UpdatePhoneNumberCommand = exports.de_UpdateEntitlementsCommand = exports.de_UnlinkSocialCommand = exports.de_RequestPhoneUpdateOtpCommand = void 0;
3
+ exports.de_LinkEmailCommand = exports.de_GetUserByEmailCommand = exports.de_GetUserCommand = exports.de_GenerateInviteCommand = exports.de_AuthSocialCommand = exports.de_RevokeDeviceCommand = exports.de_RegisterDeviceCommand = exports.de_ListMyDevicesCommand = exports.de_GetParticipantRegistryCommand = exports.de_DeleteMatchMessagesCommand = exports.se_UpgradeUserCommand = 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_SwipeCommand = exports.se_RemoveLocationCommand = exports.se_IndexLocationCommand = exports.se_GetPreferencesCommand = exports.se_DiscoverCommand = exports.se_ValidateInviteCommand = 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_GetUserByEmailCommand = exports.se_GetUserCommand = exports.se_GenerateInviteCommand = exports.se_AuthSocialCommand = exports.se_RevokeDeviceCommand = exports.se_RegisterDeviceCommand = exports.se_ListMyDevicesCommand = exports.se_GetParticipantRegistryCommand = exports.se_DeleteMatchMessagesCommand = void 0;
4
+ exports.de_UpgradeUserCommand = exports.de_UnhookCommand = 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_SwipeCommand = exports.de_RemoveLocationCommand = exports.de_IndexLocationCommand = exports.de_GetPreferencesCommand = exports.de_DiscoverCommand = exports.de_ValidateInviteCommand = exports.de_UpdatePhoneNumberCommand = exports.de_UpdateEntitlementsCommand = exports.de_UnlinkSocialCommand = exports.de_RequestPhoneUpdateOtpCommand = exports.de_RequestPhoneOtpCommand = exports.de_RequestEmailOtpCommand = exports.de_RegisterPhoneCommand = exports.de_LinkSocialCommand = void 0;
5
5
  const OneHookServiceException_1 = require("../models/OneHookServiceException");
6
6
  const models_0_1 = require("../models/models_0");
7
7
  const core_1 = require("@aws-sdk/core");
8
8
  const core_2 = require("@smithy/core");
9
9
  const smithy_client_1 = require("@smithy/smithy-client");
10
- const se_ClaimPreKeyBundleCommand = async (input, context) => {
10
+ const se_DeleteMatchMessagesCommand = async (input, context) => {
11
+ const b = (0, core_2.requestBuilder)(input, context);
12
+ const headers = {};
13
+ b.bp("/chat/match/{matchId}");
14
+ b.p('matchId', () => input.matchId, '{matchId}', false);
15
+ let body;
16
+ b.m("DELETE")
17
+ .h(headers)
18
+ .b(body);
19
+ return b.build();
20
+ };
21
+ exports.se_DeleteMatchMessagesCommand = se_DeleteMatchMessagesCommand;
22
+ const se_GetParticipantRegistryCommand = async (input, context) => {
11
23
  const b = (0, core_2.requestBuilder)(input, context);
12
24
  const headers = {};
13
- b.bp("/chat/prekeys/{userId}");
25
+ b.bp("/chat/registry/{userId}");
14
26
  b.p('userId', () => input.userId, '{userId}', false);
15
27
  const query = (0, smithy_client_1.map)({
16
28
  [_mI]: [, (0, smithy_client_1.expectNonNull)(input[_mI], `matchId`)],
17
29
  });
18
30
  let body;
19
- b.m("POST")
31
+ b.m("GET")
20
32
  .h(headers)
21
33
  .q(query)
22
34
  .b(body);
23
35
  return b.build();
24
36
  };
25
- exports.se_ClaimPreKeyBundleCommand = se_ClaimPreKeyBundleCommand;
26
- const se_DeleteMatchMessagesCommand = async (input, context) => {
37
+ exports.se_GetParticipantRegistryCommand = se_GetParticipantRegistryCommand;
38
+ const se_ListMyDevicesCommand = async (input, context) => {
27
39
  const b = (0, core_2.requestBuilder)(input, context);
28
40
  const headers = {};
29
- b.bp("/chat/match/{matchId}");
30
- b.p('matchId', () => input.matchId, '{matchId}', false);
41
+ b.bp("/chat/devices");
31
42
  let body;
32
- b.m("DELETE")
43
+ b.m("GET")
33
44
  .h(headers)
34
45
  .b(body);
35
46
  return b.build();
36
47
  };
37
- exports.se_DeleteMatchMessagesCommand = se_DeleteMatchMessagesCommand;
38
- const se_UploadPreKeysCommand = async (input, context) => {
48
+ exports.se_ListMyDevicesCommand = se_ListMyDevicesCommand;
49
+ const se_RegisterDeviceCommand = async (input, context) => {
39
50
  const b = (0, core_2.requestBuilder)(input, context);
40
51
  const headers = {
41
52
  'content-type': 'application/json',
42
53
  };
43
- b.bp("/chat/prekeys");
54
+ b.bp("/chat/devices");
44
55
  let body;
45
56
  body = JSON.stringify((0, smithy_client_1.take)(input, {
46
- 'identityKey': [],
47
- 'oneTimePreKeys': _ => (0, smithy_client_1._json)(_),
48
- 'signedPreKey': [],
57
+ 'accountHistoryKey': _ => (0, smithy_client_1._json)(_),
58
+ 'deviceId': [],
59
+ 'displayName': [],
60
+ 'maxEnvelopeVersion': [],
61
+ 'platform': [],
62
+ 'publicKey': [],
49
63
  }));
50
64
  b.m("POST")
51
65
  .h(headers)
52
66
  .b(body);
53
67
  return b.build();
54
68
  };
55
- exports.se_UploadPreKeysCommand = se_UploadPreKeysCommand;
69
+ exports.se_RegisterDeviceCommand = se_RegisterDeviceCommand;
70
+ const se_RevokeDeviceCommand = async (input, context) => {
71
+ const b = (0, core_2.requestBuilder)(input, context);
72
+ const headers = {};
73
+ b.bp("/chat/devices/{deviceId}");
74
+ b.p('deviceId', () => input.deviceId, '{deviceId}', false);
75
+ let body;
76
+ b.m("DELETE")
77
+ .h(headers)
78
+ .b(body);
79
+ return b.build();
80
+ };
81
+ exports.se_RevokeDeviceCommand = se_RevokeDeviceCommand;
56
82
  const se_AuthSocialCommand = async (input, context) => {
57
83
  const b = (0, core_2.requestBuilder)(input, context);
58
84
  const headers = {
@@ -601,7 +627,7 @@ const se_UpgradeUserCommand = async (input, context) => {
601
627
  return b.build();
602
628
  };
603
629
  exports.se_UpgradeUserCommand = se_UpgradeUserCommand;
604
- const de_ClaimPreKeyBundleCommand = async (output, context) => {
630
+ const de_DeleteMatchMessagesCommand = async (output, context) => {
605
631
  if (output.statusCode !== 200 && output.statusCode >= 300) {
606
632
  return de_CommandError(output, context);
607
633
  }
@@ -610,15 +636,13 @@ const de_ClaimPreKeyBundleCommand = async (output, context) => {
610
636
  });
611
637
  const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
612
638
  const doc = (0, smithy_client_1.take)(data, {
613
- 'identityKey': smithy_client_1.expectString,
614
- 'oneTimePreKey': smithy_client_1.expectString,
615
- 'signedPreKey': smithy_client_1.expectString,
639
+ 'deleted': smithy_client_1.expectInt32,
616
640
  });
617
641
  Object.assign(contents, doc);
618
642
  return contents;
619
643
  };
620
- exports.de_ClaimPreKeyBundleCommand = de_ClaimPreKeyBundleCommand;
621
- const de_DeleteMatchMessagesCommand = async (output, context) => {
644
+ exports.de_DeleteMatchMessagesCommand = de_DeleteMatchMessagesCommand;
645
+ const de_GetParticipantRegistryCommand = async (output, context) => {
622
646
  if (output.statusCode !== 200 && output.statusCode >= 300) {
623
647
  return de_CommandError(output, context);
624
648
  }
@@ -627,13 +651,15 @@ const de_DeleteMatchMessagesCommand = async (output, context) => {
627
651
  });
628
652
  const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
629
653
  const doc = (0, smithy_client_1.take)(data, {
630
- 'deleted': smithy_client_1.expectInt32,
654
+ 'accountHistoryKey': smithy_client_1._json,
655
+ 'devices': smithy_client_1._json,
656
+ 'userId': smithy_client_1.expectString,
631
657
  });
632
658
  Object.assign(contents, doc);
633
659
  return contents;
634
660
  };
635
- exports.de_DeleteMatchMessagesCommand = de_DeleteMatchMessagesCommand;
636
- const de_UploadPreKeysCommand = async (output, context) => {
661
+ exports.de_GetParticipantRegistryCommand = de_GetParticipantRegistryCommand;
662
+ const de_ListMyDevicesCommand = async (output, context) => {
637
663
  if (output.statusCode !== 200 && output.statusCode >= 300) {
638
664
  return de_CommandError(output, context);
639
665
  }
@@ -642,12 +668,46 @@ const de_UploadPreKeysCommand = async (output, context) => {
642
668
  });
643
669
  const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
644
670
  const doc = (0, smithy_client_1.take)(data, {
645
- 'status': smithy_client_1.expectString,
671
+ 'accountHistoryKey': smithy_client_1._json,
672
+ 'devices': smithy_client_1._json,
673
+ });
674
+ Object.assign(contents, doc);
675
+ return contents;
676
+ };
677
+ exports.de_ListMyDevicesCommand = de_ListMyDevicesCommand;
678
+ const de_RegisterDeviceCommand = async (output, context) => {
679
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
680
+ return de_CommandError(output, context);
681
+ }
682
+ const contents = (0, smithy_client_1.map)({
683
+ $metadata: deserializeMetadata(output),
684
+ });
685
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
686
+ const doc = (0, smithy_client_1.take)(data, {
687
+ 'accountHistoryKey': smithy_client_1._json,
688
+ 'device': smithy_client_1._json,
689
+ 'ownsAccountHistoryKey': smithy_client_1.expectBoolean,
690
+ });
691
+ Object.assign(contents, doc);
692
+ return contents;
693
+ };
694
+ exports.de_RegisterDeviceCommand = de_RegisterDeviceCommand;
695
+ const de_RevokeDeviceCommand = async (output, context) => {
696
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
697
+ return de_CommandError(output, context);
698
+ }
699
+ const contents = (0, smithy_client_1.map)({
700
+ $metadata: deserializeMetadata(output),
701
+ });
702
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
703
+ const doc = (0, smithy_client_1.take)(data, {
704
+ 'deviceId': smithy_client_1.expectString,
705
+ 'revoked': smithy_client_1.expectBoolean,
646
706
  });
647
707
  Object.assign(contents, doc);
648
708
  return contents;
649
709
  };
650
- exports.de_UploadPreKeysCommand = de_UploadPreKeysCommand;
710
+ exports.de_RevokeDeviceCommand = de_RevokeDeviceCommand;
651
711
  const de_AuthSocialCommand = async (output, context) => {
652
712
  if (output.statusCode !== 200 && output.statusCode >= 300) {
653
713
  return de_CommandError(output, context);
@@ -1321,6 +1381,9 @@ const de_CommandError = async (output, context) => {
1321
1381
  case "NotFoundError":
1322
1382
  case "club.onehook.identity#NotFoundError":
1323
1383
  throw await de_NotFoundErrorRes(parsedOutput, context);
1384
+ case "DeviceLimitError":
1385
+ case "club.onehook.chat#DeviceLimitError":
1386
+ throw await de_DeviceLimitErrorRes(parsedOutput, context);
1324
1387
  default:
1325
1388
  const parsedBody = parsedOutput.body;
1326
1389
  return throwDefaultError({
@@ -1331,6 +1394,19 @@ const de_CommandError = async (output, context) => {
1331
1394
  }
1332
1395
  };
1333
1396
  const throwDefaultError = (0, smithy_client_1.withBaseException)(OneHookServiceException_1.OneHookServiceException);
1397
+ const de_DeviceLimitErrorRes = async (parsedOutput, context) => {
1398
+ const contents = (0, smithy_client_1.map)({});
1399
+ const data = parsedOutput.body;
1400
+ const doc = (0, smithy_client_1.take)(data, {
1401
+ 'error': smithy_client_1.expectString,
1402
+ });
1403
+ Object.assign(contents, doc);
1404
+ const exception = new models_0_1.DeviceLimitError({
1405
+ $metadata: deserializeMetadata(parsedOutput),
1406
+ ...contents
1407
+ });
1408
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1409
+ };
1334
1410
  const de_ForbiddenErrorRes = async (parsedOutput, context) => {
1335
1411
  const contents = (0, smithy_client_1.map)({});
1336
1412
  const data = parsedOutput.body;
@@ -1,6 +1,5 @@
1
1
  import { OneHookClient, } from "./OneHookClient";
2
2
  import { AuthSocialCommand, } from "./commands/AuthSocialCommand";
3
- import { ClaimPreKeyBundleCommand, } from "./commands/ClaimPreKeyBundleCommand";
4
3
  import { CompleteLivenessSessionCommand, } from "./commands/CompleteLivenessSessionCommand";
5
4
  import { CompleteOnboardingCommand, } from "./commands/CompleteOnboardingCommand";
6
5
  import { CreateLivenessSessionCommand, } from "./commands/CreateLivenessSessionCommand";
@@ -13,6 +12,7 @@ import { GenerateUploadUrlCommand, } from "./commands/GenerateUploadUrlCommand";
13
12
  import { GetLivenessStatusCommand, } from "./commands/GetLivenessStatusCommand";
14
13
  import { GetMatchCommand, } from "./commands/GetMatchCommand";
15
14
  import { GetMyProfileCommand, } from "./commands/GetMyProfileCommand";
15
+ import { GetParticipantRegistryCommand, } from "./commands/GetParticipantRegistryCommand";
16
16
  import { GetPreferencesCommand, } from "./commands/GetPreferencesCommand";
17
17
  import { GetProfileCommand, } from "./commands/GetProfileCommand";
18
18
  import { GetStateCommand, } from "./commands/GetStateCommand";
@@ -22,11 +22,14 @@ import { IndexLocationCommand, } from "./commands/IndexLocationCommand";
22
22
  import { InitUserCommand, } from "./commands/InitUserCommand";
23
23
  import { LinkEmailCommand, } from "./commands/LinkEmailCommand";
24
24
  import { LinkSocialCommand, } from "./commands/LinkSocialCommand";
25
+ import { ListMyDevicesCommand, } from "./commands/ListMyDevicesCommand";
26
+ import { RegisterDeviceCommand, } from "./commands/RegisterDeviceCommand";
25
27
  import { RegisterPhoneCommand, } from "./commands/RegisterPhoneCommand";
26
28
  import { RemoveLocationCommand, } from "./commands/RemoveLocationCommand";
27
29
  import { RequestEmailOtpCommand, } from "./commands/RequestEmailOtpCommand";
28
30
  import { RequestPhoneOtpCommand, } from "./commands/RequestPhoneOtpCommand";
29
31
  import { RequestPhoneUpdateOtpCommand, } from "./commands/RequestPhoneUpdateOtpCommand";
32
+ import { RevokeDeviceCommand, } from "./commands/RevokeDeviceCommand";
30
33
  import { SwipeCommand, } from "./commands/SwipeCommand";
31
34
  import { UnhookCommand, } from "./commands/UnhookCommand";
32
35
  import { UnlinkSocialCommand, } from "./commands/UnlinkSocialCommand";
@@ -35,13 +38,14 @@ import { UpdatePhoneNumberCommand, } from "./commands/UpdatePhoneNumberCommand";
35
38
  import { UpdatePreferencesCommand, } from "./commands/UpdatePreferencesCommand";
36
39
  import { UpdateProfileCommand, } from "./commands/UpdateProfileCommand";
37
40
  import { UpgradeUserCommand, } from "./commands/UpgradeUserCommand";
38
- import { UploadPreKeysCommand, } from "./commands/UploadPreKeysCommand";
39
41
  import { ValidateInviteCommand, } from "./commands/ValidateInviteCommand";
40
42
  import { createAggregatedClient } from "@smithy/smithy-client";
41
43
  const commands = {
42
- ClaimPreKeyBundleCommand,
43
44
  DeleteMatchMessagesCommand,
44
- UploadPreKeysCommand,
45
+ GetParticipantRegistryCommand,
46
+ ListMyDevicesCommand,
47
+ RegisterDeviceCommand,
48
+ RevokeDeviceCommand,
45
49
  AuthSocialCommand,
46
50
  GenerateInviteCommand,
47
51
  GetUserCommand,
@@ -0,0 +1,17 @@
1
+ import { de_GetParticipantRegistryCommand, se_GetParticipantRegistryCommand, } 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 GetParticipantRegistryCommand extends $Command.classBuilder()
6
+ .m(function (Command, cs, config, o) {
7
+ return [
8
+ getSerdePlugin(config, this.serialize, this.deserialize),
9
+ ];
10
+ })
11
+ .s("OneHookService", "GetParticipantRegistry", {})
12
+ .n("OneHookClient", "GetParticipantRegistryCommand")
13
+ .f(void 0, void 0)
14
+ .ser(se_GetParticipantRegistryCommand)
15
+ .de(de_GetParticipantRegistryCommand)
16
+ .build() {
17
+ }