onehook-api-client 1.0.6 → 1.0.7

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.
@@ -1,5 +1,5 @@
1
1
  import { OneHookServiceException as __BaseException } from "../models/OneHookServiceException";
2
- import { BadRequestError, ForbiddenError, InternalServerError, NotFoundError, } from "../models/models_0";
2
+ import { BadRequestError, DeviceLimitError, ForbiddenError, InternalServerError, NotFoundError, } from "../models/models_0";
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";
@@ -29,6 +29,62 @@ export const se_DeleteMatchMessagesCommand = async (input, context) => {
29
29
  .b(body);
30
30
  return b.build();
31
31
  };
32
+ export const se_GetParticipantRegistryCommand = async (input, context) => {
33
+ const b = rb(input, context);
34
+ const headers = {};
35
+ b.bp("/chat/registry/{userId}");
36
+ b.p('userId', () => input.userId, '{userId}', false);
37
+ const query = map({
38
+ [_mI]: [, __expectNonNull(input[_mI], `matchId`)],
39
+ });
40
+ let body;
41
+ b.m("GET")
42
+ .h(headers)
43
+ .q(query)
44
+ .b(body);
45
+ return b.build();
46
+ };
47
+ export const se_ListMyDevicesCommand = async (input, context) => {
48
+ const b = rb(input, context);
49
+ const headers = {};
50
+ b.bp("/chat/devices");
51
+ let body;
52
+ b.m("GET")
53
+ .h(headers)
54
+ .b(body);
55
+ return b.build();
56
+ };
57
+ export const se_RegisterDeviceCommand = async (input, context) => {
58
+ const b = rb(input, context);
59
+ const headers = {
60
+ 'content-type': 'application/json',
61
+ };
62
+ b.bp("/chat/devices");
63
+ let body;
64
+ body = JSON.stringify(take(input, {
65
+ 'accountHistoryKey': _ => _json(_),
66
+ 'deviceId': [],
67
+ 'displayName': [],
68
+ 'maxEnvelopeVersion': [],
69
+ 'platform': [],
70
+ 'publicKey': [],
71
+ }));
72
+ b.m("POST")
73
+ .h(headers)
74
+ .b(body);
75
+ return b.build();
76
+ };
77
+ export const se_RevokeDeviceCommand = async (input, context) => {
78
+ const b = rb(input, context);
79
+ const headers = {};
80
+ b.bp("/chat/devices/{deviceId}");
81
+ b.p('deviceId', () => input.deviceId, '{deviceId}', false);
82
+ let body;
83
+ b.m("DELETE")
84
+ .h(headers)
85
+ .b(body);
86
+ return b.build();
87
+ };
32
88
  export const se_UploadPreKeysCommand = async (input, context) => {
33
89
  const b = rb(input, context);
34
90
  const headers = {
@@ -589,6 +645,68 @@ export const de_DeleteMatchMessagesCommand = async (output, context) => {
589
645
  Object.assign(contents, doc);
590
646
  return contents;
591
647
  };
648
+ export const de_GetParticipantRegistryCommand = async (output, context) => {
649
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
650
+ return de_CommandError(output, context);
651
+ }
652
+ const contents = map({
653
+ $metadata: deserializeMetadata(output),
654
+ });
655
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
656
+ const doc = take(data, {
657
+ 'accountHistoryKey': _json,
658
+ 'devices': _json,
659
+ 'userId': __expectString,
660
+ });
661
+ Object.assign(contents, doc);
662
+ return contents;
663
+ };
664
+ export const de_ListMyDevicesCommand = async (output, context) => {
665
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
666
+ return de_CommandError(output, context);
667
+ }
668
+ const contents = map({
669
+ $metadata: deserializeMetadata(output),
670
+ });
671
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
672
+ const doc = take(data, {
673
+ 'accountHistoryKey': _json,
674
+ 'devices': _json,
675
+ });
676
+ Object.assign(contents, doc);
677
+ return contents;
678
+ };
679
+ export const de_RegisterDeviceCommand = async (output, context) => {
680
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
681
+ return de_CommandError(output, context);
682
+ }
683
+ const contents = map({
684
+ $metadata: deserializeMetadata(output),
685
+ });
686
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
687
+ const doc = take(data, {
688
+ 'accountHistoryKey': _json,
689
+ 'device': _json,
690
+ 'ownsAccountHistoryKey': __expectBoolean,
691
+ });
692
+ Object.assign(contents, doc);
693
+ return contents;
694
+ };
695
+ export const de_RevokeDeviceCommand = async (output, context) => {
696
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
697
+ return de_CommandError(output, context);
698
+ }
699
+ const contents = map({
700
+ $metadata: deserializeMetadata(output),
701
+ });
702
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
703
+ const doc = take(data, {
704
+ 'deviceId': __expectString,
705
+ 'revoked': __expectBoolean,
706
+ });
707
+ Object.assign(contents, doc);
708
+ return contents;
709
+ };
592
710
  export const de_UploadPreKeysCommand = async (output, context) => {
593
711
  if (output.statusCode !== 200 && output.statusCode >= 300) {
594
712
  return de_CommandError(output, context);
@@ -1241,6 +1359,9 @@ const de_CommandError = async (output, context) => {
1241
1359
  case "NotFoundError":
1242
1360
  case "club.onehook.identity#NotFoundError":
1243
1361
  throw await de_NotFoundErrorRes(parsedOutput, context);
1362
+ case "DeviceLimitError":
1363
+ case "club.onehook.chat#DeviceLimitError":
1364
+ throw await de_DeviceLimitErrorRes(parsedOutput, context);
1244
1365
  default:
1245
1366
  const parsedBody = parsedOutput.body;
1246
1367
  return throwDefaultError({
@@ -1251,6 +1372,19 @@ const de_CommandError = async (output, context) => {
1251
1372
  }
1252
1373
  };
1253
1374
  const throwDefaultError = withBaseException(__BaseException);
1375
+ const de_DeviceLimitErrorRes = async (parsedOutput, context) => {
1376
+ const contents = map({});
1377
+ const data = parsedOutput.body;
1378
+ const doc = take(data, {
1379
+ 'error': __expectString,
1380
+ });
1381
+ Object.assign(contents, doc);
1382
+ const exception = new DeviceLimitError({
1383
+ $metadata: deserializeMetadata(parsedOutput),
1384
+ ...contents
1385
+ });
1386
+ return __decorateServiceException(exception, parsedOutput.body);
1387
+ };
1254
1388
  const de_ForbiddenErrorRes = async (parsedOutput, context) => {
1255
1389
  const contents = map({});
1256
1390
  const data = parsedOutput.body;
@@ -13,6 +13,7 @@ import { GenerateUploadUrlCommandInput, GenerateUploadUrlCommandOutput } from ".
13
13
  import { GetLivenessStatusCommandInput, GetLivenessStatusCommandOutput } from "./commands/GetLivenessStatusCommand";
14
14
  import { GetMatchCommandInput, GetMatchCommandOutput } from "./commands/GetMatchCommand";
15
15
  import { GetMyProfileCommandInput, GetMyProfileCommandOutput } from "./commands/GetMyProfileCommand";
16
+ import { GetParticipantRegistryCommandInput, GetParticipantRegistryCommandOutput } from "./commands/GetParticipantRegistryCommand";
16
17
  import { GetPreferencesCommandInput, GetPreferencesCommandOutput } from "./commands/GetPreferencesCommand";
17
18
  import { GetProfileCommandInput, GetProfileCommandOutput } from "./commands/GetProfileCommand";
18
19
  import { GetStateCommandInput, GetStateCommandOutput } from "./commands/GetStateCommand";
@@ -22,11 +23,14 @@ import { IndexLocationCommandInput, IndexLocationCommandOutput } from "./command
22
23
  import { InitUserCommandInput, InitUserCommandOutput } from "./commands/InitUserCommand";
23
24
  import { LinkEmailCommandInput, LinkEmailCommandOutput } from "./commands/LinkEmailCommand";
24
25
  import { LinkSocialCommandInput, LinkSocialCommandOutput } from "./commands/LinkSocialCommand";
26
+ import { ListMyDevicesCommandInput, ListMyDevicesCommandOutput } from "./commands/ListMyDevicesCommand";
27
+ import { RegisterDeviceCommandInput, RegisterDeviceCommandOutput } from "./commands/RegisterDeviceCommand";
25
28
  import { RegisterPhoneCommandInput, RegisterPhoneCommandOutput } from "./commands/RegisterPhoneCommand";
26
29
  import { RemoveLocationCommandInput, RemoveLocationCommandOutput } from "./commands/RemoveLocationCommand";
27
30
  import { RequestEmailOtpCommandInput, RequestEmailOtpCommandOutput } from "./commands/RequestEmailOtpCommand";
28
31
  import { RequestPhoneOtpCommandInput, RequestPhoneOtpCommandOutput } from "./commands/RequestPhoneOtpCommand";
29
32
  import { RequestPhoneUpdateOtpCommandInput, RequestPhoneUpdateOtpCommandOutput } from "./commands/RequestPhoneUpdateOtpCommand";
33
+ import { RevokeDeviceCommandInput, RevokeDeviceCommandOutput } from "./commands/RevokeDeviceCommand";
30
34
  import { SwipeCommandInput, SwipeCommandOutput } from "./commands/SwipeCommand";
31
35
  import { UnhookCommandInput, UnhookCommandOutput } from "./commands/UnhookCommand";
32
36
  import { UnlinkSocialCommandInput, UnlinkSocialCommandOutput } from "./commands/UnlinkSocialCommand";
@@ -51,6 +55,31 @@ export interface OneHook {
51
55
  deleteMatchMessages(args: DeleteMatchMessagesCommandInput, options?: __HttpHandlerOptions): Promise<DeleteMatchMessagesCommandOutput>;
52
56
  deleteMatchMessages(args: DeleteMatchMessagesCommandInput, cb: (err: any, data?: DeleteMatchMessagesCommandOutput) => void): void;
53
57
  deleteMatchMessages(args: DeleteMatchMessagesCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DeleteMatchMessagesCommandOutput) => void): void;
58
+ /**
59
+ * @see {@link GetParticipantRegistryCommand}
60
+ */
61
+ getParticipantRegistry(args: GetParticipantRegistryCommandInput, options?: __HttpHandlerOptions): Promise<GetParticipantRegistryCommandOutput>;
62
+ getParticipantRegistry(args: GetParticipantRegistryCommandInput, cb: (err: any, data?: GetParticipantRegistryCommandOutput) => void): void;
63
+ getParticipantRegistry(args: GetParticipantRegistryCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetParticipantRegistryCommandOutput) => void): void;
64
+ /**
65
+ * @see {@link ListMyDevicesCommand}
66
+ */
67
+ listMyDevices(): Promise<ListMyDevicesCommandOutput>;
68
+ listMyDevices(args: ListMyDevicesCommandInput, options?: __HttpHandlerOptions): Promise<ListMyDevicesCommandOutput>;
69
+ listMyDevices(args: ListMyDevicesCommandInput, cb: (err: any, data?: ListMyDevicesCommandOutput) => void): void;
70
+ listMyDevices(args: ListMyDevicesCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListMyDevicesCommandOutput) => void): void;
71
+ /**
72
+ * @see {@link RegisterDeviceCommand}
73
+ */
74
+ registerDevice(args: RegisterDeviceCommandInput, options?: __HttpHandlerOptions): Promise<RegisterDeviceCommandOutput>;
75
+ registerDevice(args: RegisterDeviceCommandInput, cb: (err: any, data?: RegisterDeviceCommandOutput) => void): void;
76
+ registerDevice(args: RegisterDeviceCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: RegisterDeviceCommandOutput) => void): void;
77
+ /**
78
+ * @see {@link RevokeDeviceCommand}
79
+ */
80
+ revokeDevice(args: RevokeDeviceCommandInput, options?: __HttpHandlerOptions): Promise<RevokeDeviceCommandOutput>;
81
+ revokeDevice(args: RevokeDeviceCommandInput, cb: (err: any, data?: RevokeDeviceCommandOutput) => void): void;
82
+ revokeDevice(args: RevokeDeviceCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: RevokeDeviceCommandOutput) => void): void;
54
83
  /**
55
84
  * @see {@link UploadPreKeysCommand}
56
85
  */
@@ -13,6 +13,7 @@ import { GenerateUploadUrlCommandInput, GenerateUploadUrlCommandOutput } from ".
13
13
  import { GetLivenessStatusCommandInput, GetLivenessStatusCommandOutput } from "./commands/GetLivenessStatusCommand";
14
14
  import { GetMatchCommandInput, GetMatchCommandOutput } from "./commands/GetMatchCommand";
15
15
  import { GetMyProfileCommandInput, GetMyProfileCommandOutput } from "./commands/GetMyProfileCommand";
16
+ import { GetParticipantRegistryCommandInput, GetParticipantRegistryCommandOutput } from "./commands/GetParticipantRegistryCommand";
16
17
  import { GetPreferencesCommandInput, GetPreferencesCommandOutput } from "./commands/GetPreferencesCommand";
17
18
  import { GetProfileCommandInput, GetProfileCommandOutput } from "./commands/GetProfileCommand";
18
19
  import { GetStateCommandInput, GetStateCommandOutput } from "./commands/GetStateCommand";
@@ -22,11 +23,14 @@ import { IndexLocationCommandInput, IndexLocationCommandOutput } from "./command
22
23
  import { InitUserCommandInput, InitUserCommandOutput } from "./commands/InitUserCommand";
23
24
  import { LinkEmailCommandInput, LinkEmailCommandOutput } from "./commands/LinkEmailCommand";
24
25
  import { LinkSocialCommandInput, LinkSocialCommandOutput } from "./commands/LinkSocialCommand";
26
+ import { ListMyDevicesCommandInput, ListMyDevicesCommandOutput } from "./commands/ListMyDevicesCommand";
27
+ import { RegisterDeviceCommandInput, RegisterDeviceCommandOutput } from "./commands/RegisterDeviceCommand";
25
28
  import { RegisterPhoneCommandInput, RegisterPhoneCommandOutput } from "./commands/RegisterPhoneCommand";
26
29
  import { RemoveLocationCommandInput, RemoveLocationCommandOutput } from "./commands/RemoveLocationCommand";
27
30
  import { RequestEmailOtpCommandInput, RequestEmailOtpCommandOutput } from "./commands/RequestEmailOtpCommand";
28
31
  import { RequestPhoneOtpCommandInput, RequestPhoneOtpCommandOutput } from "./commands/RequestPhoneOtpCommand";
29
32
  import { RequestPhoneUpdateOtpCommandInput, RequestPhoneUpdateOtpCommandOutput } from "./commands/RequestPhoneUpdateOtpCommand";
33
+ import { RevokeDeviceCommandInput, RevokeDeviceCommandOutput } from "./commands/RevokeDeviceCommand";
30
34
  import { SwipeCommandInput, SwipeCommandOutput } from "./commands/SwipeCommand";
31
35
  import { UnhookCommandInput, UnhookCommandOutput } from "./commands/UnhookCommand";
32
36
  import { UnlinkSocialCommandInput, UnlinkSocialCommandOutput } from "./commands/UnlinkSocialCommand";
@@ -49,11 +53,11 @@ export { __Client };
49
53
  /**
50
54
  * @public
51
55
  */
52
- export type ServiceInputTypes = AuthSocialCommandInput | ClaimPreKeyBundleCommandInput | CompleteLivenessSessionCommandInput | CompleteOnboardingCommandInput | CreateLivenessSessionCommandInput | DeleteMatchMessagesCommandInput | DeleteProfileCommandInput | DiscoverCommandInput | GenerateDownloadUrlCommandInput | GenerateInviteCommandInput | GenerateUploadUrlCommandInput | GetLivenessStatusCommandInput | GetMatchCommandInput | GetMyProfileCommandInput | GetPreferencesCommandInput | GetProfileCommandInput | GetStateCommandInput | GetUserByEmailCommandInput | GetUserCommandInput | IndexLocationCommandInput | InitUserCommandInput | LinkEmailCommandInput | LinkSocialCommandInput | RegisterPhoneCommandInput | RemoveLocationCommandInput | RequestEmailOtpCommandInput | RequestPhoneOtpCommandInput | RequestPhoneUpdateOtpCommandInput | SwipeCommandInput | UnhookCommandInput | UnlinkSocialCommandInput | UpdateEntitlementsCommandInput | UpdatePhoneNumberCommandInput | UpdatePreferencesCommandInput | UpdateProfileCommandInput | UpgradeUserCommandInput | UploadPreKeysCommandInput | ValidateInviteCommandInput;
56
+ export type ServiceInputTypes = AuthSocialCommandInput | ClaimPreKeyBundleCommandInput | CompleteLivenessSessionCommandInput | CompleteOnboardingCommandInput | CreateLivenessSessionCommandInput | DeleteMatchMessagesCommandInput | DeleteProfileCommandInput | DiscoverCommandInput | GenerateDownloadUrlCommandInput | GenerateInviteCommandInput | GenerateUploadUrlCommandInput | GetLivenessStatusCommandInput | GetMatchCommandInput | GetMyProfileCommandInput | GetParticipantRegistryCommandInput | GetPreferencesCommandInput | GetProfileCommandInput | GetStateCommandInput | GetUserByEmailCommandInput | GetUserCommandInput | IndexLocationCommandInput | InitUserCommandInput | LinkEmailCommandInput | LinkSocialCommandInput | ListMyDevicesCommandInput | RegisterDeviceCommandInput | RegisterPhoneCommandInput | RemoveLocationCommandInput | RequestEmailOtpCommandInput | RequestPhoneOtpCommandInput | RequestPhoneUpdateOtpCommandInput | RevokeDeviceCommandInput | SwipeCommandInput | UnhookCommandInput | UnlinkSocialCommandInput | UpdateEntitlementsCommandInput | UpdatePhoneNumberCommandInput | UpdatePreferencesCommandInput | UpdateProfileCommandInput | UpgradeUserCommandInput | UploadPreKeysCommandInput | ValidateInviteCommandInput;
53
57
  /**
54
58
  * @public
55
59
  */
56
- export type ServiceOutputTypes = AuthSocialCommandOutput | ClaimPreKeyBundleCommandOutput | CompleteLivenessSessionCommandOutput | CompleteOnboardingCommandOutput | CreateLivenessSessionCommandOutput | DeleteMatchMessagesCommandOutput | DeleteProfileCommandOutput | DiscoverCommandOutput | GenerateDownloadUrlCommandOutput | GenerateInviteCommandOutput | GenerateUploadUrlCommandOutput | GetLivenessStatusCommandOutput | GetMatchCommandOutput | GetMyProfileCommandOutput | GetPreferencesCommandOutput | GetProfileCommandOutput | GetStateCommandOutput | GetUserByEmailCommandOutput | GetUserCommandOutput | IndexLocationCommandOutput | InitUserCommandOutput | LinkEmailCommandOutput | LinkSocialCommandOutput | RegisterPhoneCommandOutput | RemoveLocationCommandOutput | RequestEmailOtpCommandOutput | RequestPhoneOtpCommandOutput | RequestPhoneUpdateOtpCommandOutput | SwipeCommandOutput | UnhookCommandOutput | UnlinkSocialCommandOutput | UpdateEntitlementsCommandOutput | UpdatePhoneNumberCommandOutput | UpdatePreferencesCommandOutput | UpdateProfileCommandOutput | UpgradeUserCommandOutput | UploadPreKeysCommandOutput | ValidateInviteCommandOutput;
60
+ export type ServiceOutputTypes = AuthSocialCommandOutput | ClaimPreKeyBundleCommandOutput | CompleteLivenessSessionCommandOutput | CompleteOnboardingCommandOutput | CreateLivenessSessionCommandOutput | DeleteMatchMessagesCommandOutput | DeleteProfileCommandOutput | DiscoverCommandOutput | GenerateDownloadUrlCommandOutput | GenerateInviteCommandOutput | GenerateUploadUrlCommandOutput | GetLivenessStatusCommandOutput | GetMatchCommandOutput | GetMyProfileCommandOutput | GetParticipantRegistryCommandOutput | GetPreferencesCommandOutput | GetProfileCommandOutput | GetStateCommandOutput | GetUserByEmailCommandOutput | GetUserCommandOutput | IndexLocationCommandOutput | InitUserCommandOutput | LinkEmailCommandOutput | LinkSocialCommandOutput | ListMyDevicesCommandOutput | RegisterDeviceCommandOutput | RegisterPhoneCommandOutput | RemoveLocationCommandOutput | RequestEmailOtpCommandOutput | RequestPhoneOtpCommandOutput | RequestPhoneUpdateOtpCommandOutput | RevokeDeviceCommandOutput | SwipeCommandOutput | UnhookCommandOutput | UnlinkSocialCommandOutput | UpdateEntitlementsCommandOutput | UpdatePhoneNumberCommandOutput | UpdatePreferencesCommandOutput | UpdateProfileCommandOutput | UpgradeUserCommandOutput | UploadPreKeysCommandOutput | ValidateInviteCommandOutput;
57
61
  /**
58
62
  * @public
59
63
  */
@@ -0,0 +1,99 @@
1
+ import { OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../OneHookClient";
2
+ import { GetParticipantRegistryRequest, GetParticipantRegistryResponse } 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 GetParticipantRegistryCommand}.
14
+ */
15
+ export interface GetParticipantRegistryCommandInput extends GetParticipantRegistryRequest {
16
+ }
17
+ /**
18
+ * @public
19
+ *
20
+ * The output of {@link GetParticipantRegistryCommand}.
21
+ */
22
+ export interface GetParticipantRegistryCommandOutput extends GetParticipantRegistryResponse, __MetadataBearer {
23
+ }
24
+ declare const GetParticipantRegistryCommand_base: {
25
+ new (input: GetParticipantRegistryCommandInput): import("@smithy/smithy-client").CommandImpl<GetParticipantRegistryCommandInput, GetParticipantRegistryCommandOutput, OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
26
+ new (__0_0: GetParticipantRegistryCommandInput): import("@smithy/smithy-client").CommandImpl<GetParticipantRegistryCommandInput, GetParticipantRegistryCommandOutput, OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
27
+ getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
28
+ };
29
+ /**
30
+ * Fetch a match participant's device registry so the caller can encrypt to every one of the
31
+ * participant's devices. Authorized by a shared `matchId` (same gate as ClaimPreKeyBundle);
32
+ * exposes only public key material.
33
+ * @example
34
+ * Use a bare-bones client and the command you need to make an API call.
35
+ * ```javascript
36
+ * import { OneHookClient, GetParticipantRegistryCommand } from "onehook-api-client"; // ES Modules import
37
+ * // const { OneHookClient, GetParticipantRegistryCommand } = require("onehook-api-client"); // CommonJS import
38
+ * const client = new OneHookClient(config);
39
+ * const input = { // GetParticipantRegistryRequest
40
+ * userId: "STRING_VALUE", // required
41
+ * matchId: "STRING_VALUE", // required
42
+ * };
43
+ * const command = new GetParticipantRegistryCommand(input);
44
+ * const response = await client.send(command);
45
+ * // { // GetParticipantRegistryResponse
46
+ * // userId: "STRING_VALUE", // required
47
+ * // devices: [ // DeviceList // required
48
+ * // { // Device
49
+ * // deviceId: "STRING_VALUE", // required
50
+ * // publicKey: "STRING_VALUE", // required
51
+ * // platform: "IOS" || "ANDROID" || "WEB", // required
52
+ * // displayName: "STRING_VALUE",
53
+ * // maxEnvelopeVersion: Number("int"), // required
54
+ * // createdAt: Number("long"), // required
55
+ * // lastSeenAt: Number("long"), // required
56
+ * // current: true || false, // required
57
+ * // },
58
+ * // ],
59
+ * // accountHistoryKey: { // AccountHistoryKey
60
+ * // keyId: "STRING_VALUE", // required
61
+ * // publicKey: "STRING_VALUE", // required
62
+ * // },
63
+ * // };
64
+ *
65
+ * ```
66
+ *
67
+ * @param GetParticipantRegistryCommandInput - {@link GetParticipantRegistryCommandInput}
68
+ * @returns {@link GetParticipantRegistryCommandOutput}
69
+ * @see {@link GetParticipantRegistryCommandInput} for command's `input` shape.
70
+ * @see {@link GetParticipantRegistryCommandOutput} for command's `response` shape.
71
+ * @see {@link OneHookClientResolvedConfig | config} for OneHookClient's `config` shape.
72
+ *
73
+ * @throws {@link BadRequestError} (client fault)
74
+ *
75
+ * @throws {@link ForbiddenError} (client fault)
76
+ *
77
+ * @throws {@link NotFoundError} (client fault)
78
+ *
79
+ * @throws {@link InternalServerError} (server fault)
80
+ *
81
+ * @throws {@link OneHookServiceException}
82
+ * <p>Base exception class for all service exceptions from OneHook service.</p>
83
+ *
84
+ *
85
+ * @public
86
+ */
87
+ export declare class GetParticipantRegistryCommand extends GetParticipantRegistryCommand_base {
88
+ /** @internal type navigation helper, not in runtime. */
89
+ protected static __types: {
90
+ api: {
91
+ input: GetParticipantRegistryRequest;
92
+ output: GetParticipantRegistryResponse;
93
+ };
94
+ sdk: {
95
+ input: GetParticipantRegistryCommandInput;
96
+ output: GetParticipantRegistryCommandOutput;
97
+ };
98
+ };
99
+ }
@@ -0,0 +1,89 @@
1
+ import { OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../OneHookClient";
2
+ import { ListMyDevicesRequest, ListMyDevicesResponse } 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 ListMyDevicesCommand}.
14
+ */
15
+ export interface ListMyDevicesCommandInput extends ListMyDevicesRequest {
16
+ }
17
+ /**
18
+ * @public
19
+ *
20
+ * The output of {@link ListMyDevicesCommand}.
21
+ */
22
+ export interface ListMyDevicesCommandOutput extends ListMyDevicesResponse, __MetadataBearer {
23
+ }
24
+ declare const ListMyDevicesCommand_base: {
25
+ new (input: ListMyDevicesCommandInput): import("@smithy/smithy-client").CommandImpl<ListMyDevicesCommandInput, ListMyDevicesCommandOutput, OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
26
+ new (...[input]: [] | [ListMyDevicesCommandInput]): import("@smithy/smithy-client").CommandImpl<ListMyDevicesCommandInput, ListMyDevicesCommandOutput, OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
27
+ getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
28
+ };
29
+ /**
30
+ * List the authenticated caller's own registered devices (and account history key, if any).
31
+ * @example
32
+ * Use a bare-bones client and the command you need to make an API call.
33
+ * ```javascript
34
+ * import { OneHookClient, ListMyDevicesCommand } from "onehook-api-client"; // ES Modules import
35
+ * // const { OneHookClient, ListMyDevicesCommand } = require("onehook-api-client"); // CommonJS import
36
+ * const client = new OneHookClient(config);
37
+ * const input = {};
38
+ * const command = new ListMyDevicesCommand(input);
39
+ * const response = await client.send(command);
40
+ * // { // ListMyDevicesResponse
41
+ * // devices: [ // DeviceList // required
42
+ * // { // Device
43
+ * // deviceId: "STRING_VALUE", // required
44
+ * // publicKey: "STRING_VALUE", // required
45
+ * // platform: "IOS" || "ANDROID" || "WEB", // required
46
+ * // displayName: "STRING_VALUE",
47
+ * // maxEnvelopeVersion: Number("int"), // required
48
+ * // createdAt: Number("long"), // required
49
+ * // lastSeenAt: Number("long"), // required
50
+ * // current: true || false, // required
51
+ * // },
52
+ * // ],
53
+ * // accountHistoryKey: { // AccountHistoryKey
54
+ * // keyId: "STRING_VALUE", // required
55
+ * // publicKey: "STRING_VALUE", // required
56
+ * // },
57
+ * // };
58
+ *
59
+ * ```
60
+ *
61
+ * @param ListMyDevicesCommandInput - {@link ListMyDevicesCommandInput}
62
+ * @returns {@link ListMyDevicesCommandOutput}
63
+ * @see {@link ListMyDevicesCommandInput} for command's `input` shape.
64
+ * @see {@link ListMyDevicesCommandOutput} for command's `response` shape.
65
+ * @see {@link OneHookClientResolvedConfig | config} for OneHookClient's `config` shape.
66
+ *
67
+ * @throws {@link ForbiddenError} (client fault)
68
+ *
69
+ * @throws {@link InternalServerError} (server fault)
70
+ *
71
+ * @throws {@link OneHookServiceException}
72
+ * <p>Base exception class for all service exceptions from OneHook service.</p>
73
+ *
74
+ *
75
+ * @public
76
+ */
77
+ export declare class ListMyDevicesCommand extends ListMyDevicesCommand_base {
78
+ /** @internal type navigation helper, not in runtime. */
79
+ protected static __types: {
80
+ api: {
81
+ input: {};
82
+ output: ListMyDevicesResponse;
83
+ };
84
+ sdk: {
85
+ input: ListMyDevicesCommandInput;
86
+ output: ListMyDevicesCommandOutput;
87
+ };
88
+ };
89
+ }
@@ -0,0 +1,112 @@
1
+ import { OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../OneHookClient";
2
+ import { RegisterDeviceRequest, RegisterDeviceResponse } 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 RegisterDeviceCommand}.
14
+ */
15
+ export interface RegisterDeviceCommandInput extends RegisterDeviceRequest {
16
+ }
17
+ /**
18
+ * @public
19
+ *
20
+ * The output of {@link RegisterDeviceCommand}.
21
+ */
22
+ export interface RegisterDeviceCommandOutput extends RegisterDeviceResponse, __MetadataBearer {
23
+ }
24
+ declare const RegisterDeviceCommand_base: {
25
+ new (input: RegisterDeviceCommandInput): import("@smithy/smithy-client").CommandImpl<RegisterDeviceCommandInput, RegisterDeviceCommandOutput, OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
26
+ new (__0_0: RegisterDeviceCommandInput): import("@smithy/smithy-client").CommandImpl<RegisterDeviceCommandInput, RegisterDeviceCommandOutput, OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
27
+ getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
28
+ };
29
+ /**
30
+ * Register (or refresh) the calling device in the authenticated user's device registry.
31
+ *
32
+ * Idempotent on `deviceId`: re-registering the same device updates its metadata and
33
+ * `lastSeenAt`. The newly-registered device becomes the `current` device; sibling devices
34
+ * are demoted. A user may have at most \{@code 10\} active devices.
35
+ *
36
+ * Optionally carries the account's immutable history key. The history key is FIRST-WRITE-WINS:
37
+ * the first device to register it owns it, and later/conflicting values are NEVER overwritten.
38
+ * When a conflicting key is submitted, the response echoes the stored key and sets
39
+ * `ownsAccountHistoryKey = false` so the client learns it does not own the account history key.
40
+ * @example
41
+ * Use a bare-bones client and the command you need to make an API call.
42
+ * ```javascript
43
+ * import { OneHookClient, RegisterDeviceCommand } from "onehook-api-client"; // ES Modules import
44
+ * // const { OneHookClient, RegisterDeviceCommand } = require("onehook-api-client"); // CommonJS import
45
+ * const client = new OneHookClient(config);
46
+ * const input = { // RegisterDeviceRequest
47
+ * deviceId: "STRING_VALUE", // required
48
+ * publicKey: "STRING_VALUE", // required
49
+ * platform: "IOS" || "ANDROID" || "WEB", // required
50
+ * displayName: "STRING_VALUE",
51
+ * maxEnvelopeVersion: Number("int"), // required
52
+ * accountHistoryKey: { // AccountHistoryKey
53
+ * keyId: "STRING_VALUE", // required
54
+ * publicKey: "STRING_VALUE", // required
55
+ * },
56
+ * };
57
+ * const command = new RegisterDeviceCommand(input);
58
+ * const response = await client.send(command);
59
+ * // { // RegisterDeviceResponse
60
+ * // device: { // Device
61
+ * // deviceId: "STRING_VALUE", // required
62
+ * // publicKey: "STRING_VALUE", // required
63
+ * // platform: "IOS" || "ANDROID" || "WEB", // required
64
+ * // displayName: "STRING_VALUE",
65
+ * // maxEnvelopeVersion: Number("int"), // required
66
+ * // createdAt: Number("long"), // required
67
+ * // lastSeenAt: Number("long"), // required
68
+ * // current: true || false, // required
69
+ * // },
70
+ * // accountHistoryKey: { // AccountHistoryKey
71
+ * // keyId: "STRING_VALUE", // required
72
+ * // publicKey: "STRING_VALUE", // required
73
+ * // },
74
+ * // ownsAccountHistoryKey: true || false, // required
75
+ * // };
76
+ *
77
+ * ```
78
+ *
79
+ * @param RegisterDeviceCommandInput - {@link RegisterDeviceCommandInput}
80
+ * @returns {@link RegisterDeviceCommandOutput}
81
+ * @see {@link RegisterDeviceCommandInput} for command's `input` shape.
82
+ * @see {@link RegisterDeviceCommandOutput} for command's `response` shape.
83
+ * @see {@link OneHookClientResolvedConfig | config} for OneHookClient's `config` shape.
84
+ *
85
+ * @throws {@link BadRequestError} (client fault)
86
+ *
87
+ * @throws {@link ForbiddenError} (client fault)
88
+ *
89
+ * @throws {@link DeviceLimitError} (client fault)
90
+ * Returned when registering a new device would exceed the per-user active-device cap.
91
+ *
92
+ * @throws {@link InternalServerError} (server fault)
93
+ *
94
+ * @throws {@link OneHookServiceException}
95
+ * <p>Base exception class for all service exceptions from OneHook service.</p>
96
+ *
97
+ *
98
+ * @public
99
+ */
100
+ export declare class RegisterDeviceCommand extends RegisterDeviceCommand_base {
101
+ /** @internal type navigation helper, not in runtime. */
102
+ protected static __types: {
103
+ api: {
104
+ input: RegisterDeviceRequest;
105
+ output: RegisterDeviceResponse;
106
+ };
107
+ sdk: {
108
+ input: RegisterDeviceCommandInput;
109
+ output: RegisterDeviceCommandOutput;
110
+ };
111
+ };
112
+ }
@@ -0,0 +1,81 @@
1
+ import { OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../OneHookClient";
2
+ import { RevokeDeviceRequest, RevokeDeviceResponse } 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 RevokeDeviceCommand}.
14
+ */
15
+ export interface RevokeDeviceCommandInput extends RevokeDeviceRequest {
16
+ }
17
+ /**
18
+ * @public
19
+ *
20
+ * The output of {@link RevokeDeviceCommand}.
21
+ */
22
+ export interface RevokeDeviceCommandOutput extends RevokeDeviceResponse, __MetadataBearer {
23
+ }
24
+ declare const RevokeDeviceCommand_base: {
25
+ new (input: RevokeDeviceCommandInput): import("@smithy/smithy-client").CommandImpl<RevokeDeviceCommandInput, RevokeDeviceCommandOutput, OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
26
+ new (__0_0: RevokeDeviceCommandInput): import("@smithy/smithy-client").CommandImpl<RevokeDeviceCommandInput, RevokeDeviceCommandOutput, OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
27
+ getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
28
+ };
29
+ /**
30
+ * Revoke one of the authenticated caller's own devices, removing it from the registry.
31
+ * @example
32
+ * Use a bare-bones client and the command you need to make an API call.
33
+ * ```javascript
34
+ * import { OneHookClient, RevokeDeviceCommand } from "onehook-api-client"; // ES Modules import
35
+ * // const { OneHookClient, RevokeDeviceCommand } = require("onehook-api-client"); // CommonJS import
36
+ * const client = new OneHookClient(config);
37
+ * const input = { // RevokeDeviceRequest
38
+ * deviceId: "STRING_VALUE", // required
39
+ * };
40
+ * const command = new RevokeDeviceCommand(input);
41
+ * const response = await client.send(command);
42
+ * // { // RevokeDeviceResponse
43
+ * // deviceId: "STRING_VALUE", // required
44
+ * // revoked: true || false, // required
45
+ * // };
46
+ *
47
+ * ```
48
+ *
49
+ * @param RevokeDeviceCommandInput - {@link RevokeDeviceCommandInput}
50
+ * @returns {@link RevokeDeviceCommandOutput}
51
+ * @see {@link RevokeDeviceCommandInput} for command's `input` shape.
52
+ * @see {@link RevokeDeviceCommandOutput} for command's `response` shape.
53
+ * @see {@link OneHookClientResolvedConfig | config} for OneHookClient's `config` shape.
54
+ *
55
+ * @throws {@link BadRequestError} (client fault)
56
+ *
57
+ * @throws {@link ForbiddenError} (client fault)
58
+ *
59
+ * @throws {@link NotFoundError} (client fault)
60
+ *
61
+ * @throws {@link InternalServerError} (server fault)
62
+ *
63
+ * @throws {@link OneHookServiceException}
64
+ * <p>Base exception class for all service exceptions from OneHook service.</p>
65
+ *
66
+ *
67
+ * @public
68
+ */
69
+ export declare class RevokeDeviceCommand extends RevokeDeviceCommand_base {
70
+ /** @internal type navigation helper, not in runtime. */
71
+ protected static __types: {
72
+ api: {
73
+ input: RevokeDeviceRequest;
74
+ output: RevokeDeviceResponse;
75
+ };
76
+ sdk: {
77
+ input: RevokeDeviceCommandInput;
78
+ output: RevokeDeviceCommandOutput;
79
+ };
80
+ };
81
+ }
@@ -1,5 +1,9 @@
1
1
  export * from "./ClaimPreKeyBundleCommand";
2
2
  export * from "./DeleteMatchMessagesCommand";
3
+ export * from "./GetParticipantRegistryCommand";
4
+ export * from "./ListMyDevicesCommand";
5
+ export * from "./RegisterDeviceCommand";
6
+ export * from "./RevokeDeviceCommand";
3
7
  export * from "./UploadPreKeysCommand";
4
8
  export * from "./AuthSocialCommand";
5
9
  export * from "./GenerateInviteCommand";