onehook-api-client 1.0.12 → 1.0.14
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 +49 -0
- package/dist-cjs/OneHook.js +14 -0
- package/dist-cjs/commands/DeletePushTokenCommand.js +21 -0
- package/dist-cjs/commands/GetChatSettingsCommand.js +21 -0
- package/dist-cjs/commands/GetNotificationPreferencesCommand.js +21 -0
- package/dist-cjs/commands/GetUserIdByUsernameCommand.js +21 -0
- package/dist-cjs/commands/RegisterPushTokenCommand.js +21 -0
- package/dist-cjs/commands/SwipeByUsernameCommand.js +21 -0
- package/dist-cjs/commands/UpdateChatSettingsCommand.js +21 -0
- package/dist-cjs/commands/index.js +7 -0
- package/dist-cjs/graphql/types.js +6 -1
- package/dist-cjs/models/models_0.js +11 -6
- package/dist-cjs/protocols/Aws_restJson1.js +276 -3
- package/dist-es/OneHook.js +14 -0
- package/dist-es/commands/DeletePushTokenCommand.js +17 -0
- package/dist-es/commands/GetChatSettingsCommand.js +17 -0
- package/dist-es/commands/GetNotificationPreferencesCommand.js +17 -0
- package/dist-es/commands/GetUserIdByUsernameCommand.js +17 -0
- package/dist-es/commands/RegisterPushTokenCommand.js +17 -0
- package/dist-es/commands/SwipeByUsernameCommand.js +17 -0
- package/dist-es/commands/UpdateChatSettingsCommand.js +17 -0
- package/dist-es/commands/index.js +7 -0
- package/dist-es/graphql/types.js +5 -0
- package/dist-es/models/models_0.js +10 -5
- package/dist-es/protocols/Aws_restJson1.js +260 -1
- package/dist-types/OneHook.d.ts +51 -0
- package/dist-types/OneHookClient.d.ts +9 -2
- package/dist-types/commands/DeletePushTokenCommand.d.ts +85 -0
- package/dist-types/commands/GetChatSettingsCommand.d.ts +85 -0
- package/dist-types/commands/GetMyProfileCommand.d.ts +4 -1
- package/dist-types/commands/GetNotificationPreferencesCommand.d.ts +91 -0
- package/dist-types/commands/GetPreferencesCommand.d.ts +37 -1
- package/dist-types/commands/GetProfileCommand.d.ts +4 -1
- package/dist-types/commands/GetUserIdByUsernameCommand.d.ts +84 -0
- package/dist-types/commands/RegisterPushTokenCommand.d.ts +93 -0
- package/dist-types/commands/SwipeByUsernameCommand.d.ts +93 -0
- package/dist-types/commands/UpdateChatSettingsCommand.d.ts +95 -0
- package/dist-types/commands/UpdatePreferencesCommand.d.ts +37 -1
- package/dist-types/commands/UpdateProfileCommand.d.ts +4 -1
- package/dist-types/commands/index.d.ts +7 -0
- package/dist-types/graphql/types.d.ts +33 -0
- package/dist-types/models/models_0.d.ts +431 -13
- package/dist-types/protocols/Aws_restJson1.d.ts +63 -0
- package/package.json +1 -1
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../OneHookClient";
|
|
2
|
+
import { DeletePushTokenRequest, DeletePushTokenResponse } 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 DeletePushTokenCommand}.
|
|
14
|
+
*/
|
|
15
|
+
export interface DeletePushTokenCommandInput extends DeletePushTokenRequest {
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*
|
|
20
|
+
* The output of {@link DeletePushTokenCommand}.
|
|
21
|
+
*/
|
|
22
|
+
export interface DeletePushTokenCommandOutput extends DeletePushTokenResponse, __MetadataBearer {
|
|
23
|
+
}
|
|
24
|
+
declare const DeletePushTokenCommand_base: {
|
|
25
|
+
new (input: DeletePushTokenCommandInput): import("@smithy/smithy-client").CommandImpl<DeletePushTokenCommandInput, DeletePushTokenCommandOutput, OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
26
|
+
new (__0_0: DeletePushTokenCommandInput): import("@smithy/smithy-client").CommandImpl<DeletePushTokenCommandInput, DeletePushTokenCommandOutput, OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
27
|
+
getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Removes this device's push token WITHOUT revoking the device.
|
|
31
|
+
*
|
|
32
|
+
* Deliberately separate from `RevokeDevice`: signing out or turning notifications off should stop
|
|
33
|
+
* pushes while leaving the device's E2EE identity and its history-key wraps intact. Revoking the
|
|
34
|
+
* device instead would strand its ability to read message history.
|
|
35
|
+
* @example
|
|
36
|
+
* Use a bare-bones client and the command you need to make an API call.
|
|
37
|
+
* ```javascript
|
|
38
|
+
* import { OneHookClient, DeletePushTokenCommand } from "onehook-api-client"; // ES Modules import
|
|
39
|
+
* // const { OneHookClient, DeletePushTokenCommand } = require("onehook-api-client"); // CommonJS import
|
|
40
|
+
* const client = new OneHookClient(config);
|
|
41
|
+
* const input = { // DeletePushTokenRequest
|
|
42
|
+
* deviceId: "STRING_VALUE", // required
|
|
43
|
+
* };
|
|
44
|
+
* const command = new DeletePushTokenCommand(input);
|
|
45
|
+
* const response = await client.send(command);
|
|
46
|
+
* // { // DeletePushTokenResponse
|
|
47
|
+
* // deviceId: "STRING_VALUE", // required
|
|
48
|
+
* // deleted: true || false, // required
|
|
49
|
+
* // };
|
|
50
|
+
*
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* @param DeletePushTokenCommandInput - {@link DeletePushTokenCommandInput}
|
|
54
|
+
* @returns {@link DeletePushTokenCommandOutput}
|
|
55
|
+
* @see {@link DeletePushTokenCommandInput} for command's `input` shape.
|
|
56
|
+
* @see {@link DeletePushTokenCommandOutput} for command's `response` shape.
|
|
57
|
+
* @see {@link OneHookClientResolvedConfig | config} for OneHookClient's `config` shape.
|
|
58
|
+
*
|
|
59
|
+
* @throws {@link BadRequestError} (client fault)
|
|
60
|
+
*
|
|
61
|
+
* @throws {@link ForbiddenError} (client fault)
|
|
62
|
+
*
|
|
63
|
+
* @throws {@link NotFoundError} (client fault)
|
|
64
|
+
*
|
|
65
|
+
* @throws {@link InternalServerError} (server fault)
|
|
66
|
+
*
|
|
67
|
+
* @throws {@link OneHookServiceException}
|
|
68
|
+
* <p>Base exception class for all service exceptions from OneHook service.</p>
|
|
69
|
+
*
|
|
70
|
+
*
|
|
71
|
+
* @public
|
|
72
|
+
*/
|
|
73
|
+
export declare class DeletePushTokenCommand extends DeletePushTokenCommand_base {
|
|
74
|
+
/** @internal type navigation helper, not in runtime. */
|
|
75
|
+
protected static __types: {
|
|
76
|
+
api: {
|
|
77
|
+
input: DeletePushTokenRequest;
|
|
78
|
+
output: DeletePushTokenResponse;
|
|
79
|
+
};
|
|
80
|
+
sdk: {
|
|
81
|
+
input: DeletePushTokenCommandInput;
|
|
82
|
+
output: DeletePushTokenCommandOutput;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../OneHookClient";
|
|
2
|
+
import { GetChatSettingsRequest, GetChatSettingsResponse } 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 GetChatSettingsCommand}.
|
|
14
|
+
*/
|
|
15
|
+
export interface GetChatSettingsCommandInput extends GetChatSettingsRequest {
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*
|
|
20
|
+
* The output of {@link GetChatSettingsCommand}.
|
|
21
|
+
*/
|
|
22
|
+
export interface GetChatSettingsCommandOutput extends GetChatSettingsResponse, __MetadataBearer {
|
|
23
|
+
}
|
|
24
|
+
declare const GetChatSettingsCommand_base: {
|
|
25
|
+
new (input: GetChatSettingsCommandInput): import("@smithy/smithy-client").CommandImpl<GetChatSettingsCommandInput, GetChatSettingsCommandOutput, OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
26
|
+
new (...[input]: [] | [GetChatSettingsCommandInput]): import("@smithy/smithy-client").CommandImpl<GetChatSettingsCommandInput, GetChatSettingsCommandOutput, OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
27
|
+
getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Read the authenticated caller's chat settings. Returns sensible defaults when the user has no
|
|
31
|
+
* stored settings row (all notifications on, read receipts + typing indicators on, last-seen
|
|
32
|
+
* EVERYONE, screenshot protection off, disappearing messages off).
|
|
33
|
+
* @example
|
|
34
|
+
* Use a bare-bones client and the command you need to make an API call.
|
|
35
|
+
* ```javascript
|
|
36
|
+
* import { OneHookClient, GetChatSettingsCommand } from "onehook-api-client"; // ES Modules import
|
|
37
|
+
* // const { OneHookClient, GetChatSettingsCommand } = require("onehook-api-client"); // CommonJS import
|
|
38
|
+
* const client = new OneHookClient(config);
|
|
39
|
+
* const input = {};
|
|
40
|
+
* const command = new GetChatSettingsCommand(input);
|
|
41
|
+
* const response = await client.send(command);
|
|
42
|
+
* // { // GetChatSettingsResponse
|
|
43
|
+
* // settings: { // ChatSettings
|
|
44
|
+
* // messageNotifications: true || false,
|
|
45
|
+
* // showPreviews: true || false,
|
|
46
|
+
* // reactionNotifications: true || false,
|
|
47
|
+
* // readReceipts: true || false,
|
|
48
|
+
* // typingIndicators: true || false,
|
|
49
|
+
* // lastSeenVisibility: "EVERYONE" || "MATCHES" || "NOBODY",
|
|
50
|
+
* // screenshotProtection: true || false,
|
|
51
|
+
* // defaultDisappearingSeconds: Number("int"),
|
|
52
|
+
* // },
|
|
53
|
+
* // };
|
|
54
|
+
*
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @param GetChatSettingsCommandInput - {@link GetChatSettingsCommandInput}
|
|
58
|
+
* @returns {@link GetChatSettingsCommandOutput}
|
|
59
|
+
* @see {@link GetChatSettingsCommandInput} for command's `input` shape.
|
|
60
|
+
* @see {@link GetChatSettingsCommandOutput} for command's `response` shape.
|
|
61
|
+
* @see {@link OneHookClientResolvedConfig | config} for OneHookClient's `config` shape.
|
|
62
|
+
*
|
|
63
|
+
* @throws {@link ForbiddenError} (client fault)
|
|
64
|
+
*
|
|
65
|
+
* @throws {@link InternalServerError} (server fault)
|
|
66
|
+
*
|
|
67
|
+
* @throws {@link OneHookServiceException}
|
|
68
|
+
* <p>Base exception class for all service exceptions from OneHook service.</p>
|
|
69
|
+
*
|
|
70
|
+
*
|
|
71
|
+
* @public
|
|
72
|
+
*/
|
|
73
|
+
export declare class GetChatSettingsCommand extends GetChatSettingsCommand_base {
|
|
74
|
+
/** @internal type navigation helper, not in runtime. */
|
|
75
|
+
protected static __types: {
|
|
76
|
+
api: {
|
|
77
|
+
input: {};
|
|
78
|
+
output: GetChatSettingsResponse;
|
|
79
|
+
};
|
|
80
|
+
sdk: {
|
|
81
|
+
input: GetChatSettingsCommandInput;
|
|
82
|
+
output: GetChatSettingsCommandOutput;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
}
|
|
@@ -65,12 +65,15 @@ declare const GetMyProfileCommand_base: {
|
|
|
65
65
|
* // pictures: [
|
|
66
66
|
* // "STRING_VALUE",
|
|
67
67
|
* // ],
|
|
68
|
+
* // pictureTransforms: { // StringMap
|
|
69
|
+
* // "<keys>": "STRING_VALUE",
|
|
70
|
+
* // },
|
|
68
71
|
* // videos: [
|
|
69
72
|
* // "STRING_VALUE",
|
|
70
73
|
* // ],
|
|
71
74
|
* // audioPrompt: "STRING_VALUE",
|
|
72
75
|
* // moderationStatus: "STRING_VALUE",
|
|
73
|
-
* // fieldModerationStatus: {
|
|
76
|
+
* // fieldModerationStatus: {
|
|
74
77
|
* // "<keys>": "STRING_VALUE",
|
|
75
78
|
* // },
|
|
76
79
|
* // causes: [
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../OneHookClient";
|
|
2
|
+
import { GetNotificationPreferencesRequest, GetNotificationPreferencesResponse } 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 GetNotificationPreferencesCommand}.
|
|
14
|
+
*/
|
|
15
|
+
export interface GetNotificationPreferencesCommandInput extends GetNotificationPreferencesRequest {
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*
|
|
20
|
+
* The output of {@link GetNotificationPreferencesCommand}.
|
|
21
|
+
*/
|
|
22
|
+
export interface GetNotificationPreferencesCommandOutput extends GetNotificationPreferencesResponse, __MetadataBearer {
|
|
23
|
+
}
|
|
24
|
+
declare const GetNotificationPreferencesCommand_base: {
|
|
25
|
+
new (input: GetNotificationPreferencesCommandInput): import("@smithy/smithy-client").CommandImpl<GetNotificationPreferencesCommandInput, GetNotificationPreferencesCommandOutput, OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
26
|
+
new (__0_0: GetNotificationPreferencesCommandInput): import("@smithy/smithy-client").CommandImpl<GetNotificationPreferencesCommandInput, GetNotificationPreferencesCommandOutput, OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
27
|
+
getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Internal, IAM-authorized read of a user's notification toggles, for the push NotificationWorker.
|
|
31
|
+
*
|
|
32
|
+
* WHY A SEPARATE ROUTE. The public `GetPreferences` is strictly caller==self
|
|
33
|
+
* (`SecurityValidator.validateUserAccess`), so a worker cannot use it to read the preferences of the
|
|
34
|
+
* person it is about to notify. This route takes the userId from the PATH and is authorized with AWS
|
|
35
|
+
* IAM rather than the Cognito authorizer, so only principals granted `execute-api:Invoke` on it (the
|
|
36
|
+
* worker's role) may call it.
|
|
37
|
+
*
|
|
38
|
+
* It returns ONLY the notify flags — not the match filters, not location, not age. A worker deciding
|
|
39
|
+
* whether to send a push has no business reading who someone wants to date, and narrowing the response
|
|
40
|
+
* means a leak here cannot become a profile disclosure.
|
|
41
|
+
* @example
|
|
42
|
+
* Use a bare-bones client and the command you need to make an API call.
|
|
43
|
+
* ```javascript
|
|
44
|
+
* import { OneHookClient, GetNotificationPreferencesCommand } from "onehook-api-client"; // ES Modules import
|
|
45
|
+
* // const { OneHookClient, GetNotificationPreferencesCommand } = require("onehook-api-client"); // CommonJS import
|
|
46
|
+
* const client = new OneHookClient(config);
|
|
47
|
+
* const input = { // GetNotificationPreferencesRequest
|
|
48
|
+
* userId: "STRING_VALUE", // required
|
|
49
|
+
* };
|
|
50
|
+
* const command = new GetNotificationPreferencesCommand(input);
|
|
51
|
+
* const response = await client.send(command);
|
|
52
|
+
* // { // GetNotificationPreferencesResponse
|
|
53
|
+
* // userId: "STRING_VALUE", // required
|
|
54
|
+
* // notifyMatches: true || false, // required
|
|
55
|
+
* // notifyLikes: true || false, // required
|
|
56
|
+
* // notifyDailyPicks: true || false, // required
|
|
57
|
+
* // };
|
|
58
|
+
*
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* @param GetNotificationPreferencesCommandInput - {@link GetNotificationPreferencesCommandInput}
|
|
62
|
+
* @returns {@link GetNotificationPreferencesCommandOutput}
|
|
63
|
+
* @see {@link GetNotificationPreferencesCommandInput} for command's `input` shape.
|
|
64
|
+
* @see {@link GetNotificationPreferencesCommandOutput} for command's `response` shape.
|
|
65
|
+
* @see {@link OneHookClientResolvedConfig | config} for OneHookClient's `config` shape.
|
|
66
|
+
*
|
|
67
|
+
* @throws {@link BadRequestError} (client fault)
|
|
68
|
+
*
|
|
69
|
+
* @throws {@link NotFoundError} (client fault)
|
|
70
|
+
*
|
|
71
|
+
* @throws {@link InternalServerError} (server fault)
|
|
72
|
+
*
|
|
73
|
+
* @throws {@link OneHookServiceException}
|
|
74
|
+
* <p>Base exception class for all service exceptions from OneHook service.</p>
|
|
75
|
+
*
|
|
76
|
+
*
|
|
77
|
+
* @public
|
|
78
|
+
*/
|
|
79
|
+
export declare class GetNotificationPreferencesCommand extends GetNotificationPreferencesCommand_base {
|
|
80
|
+
/** @internal type navigation helper, not in runtime. */
|
|
81
|
+
protected static __types: {
|
|
82
|
+
api: {
|
|
83
|
+
input: GetNotificationPreferencesRequest;
|
|
84
|
+
output: GetNotificationPreferencesResponse;
|
|
85
|
+
};
|
|
86
|
+
sdk: {
|
|
87
|
+
input: GetNotificationPreferencesCommandInput;
|
|
88
|
+
output: GetNotificationPreferencesCommandOutput;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
}
|
|
@@ -45,9 +45,45 @@ declare const GetPreferencesCommand_base: {
|
|
|
45
45
|
* // minAge: Number("int"),
|
|
46
46
|
* // maxAge: Number("int"),
|
|
47
47
|
* // maxDistanceKm: Number("int"),
|
|
48
|
-
* //
|
|
48
|
+
* // interestedInGenders: [ // StringList
|
|
49
49
|
* // "STRING_VALUE",
|
|
50
50
|
* // ],
|
|
51
|
+
* // relationshipType: "STRING_VALUE",
|
|
52
|
+
* // wantsKids: "STRING_VALUE",
|
|
53
|
+
* // familyPlans: "STRING_VALUE",
|
|
54
|
+
* // verifiedOnly: true || false,
|
|
55
|
+
* // smoking: "STRING_VALUE",
|
|
56
|
+
* // drinking: "STRING_VALUE",
|
|
57
|
+
* // cannabis: "STRING_VALUE",
|
|
58
|
+
* // drugs: "STRING_VALUE",
|
|
59
|
+
* // exercise: "STRING_VALUE",
|
|
60
|
+
* // religion: "STRING_VALUE",
|
|
61
|
+
* // educationLevel: "STRING_VALUE",
|
|
62
|
+
* // politicalView: "STRING_VALUE",
|
|
63
|
+
* // starSigns: [
|
|
64
|
+
* // "STRING_VALUE",
|
|
65
|
+
* // ],
|
|
66
|
+
* // preferredLanguages: [
|
|
67
|
+
* // "STRING_VALUE",
|
|
68
|
+
* // ],
|
|
69
|
+
* // interests: [
|
|
70
|
+
* // "STRING_VALUE",
|
|
71
|
+
* // ],
|
|
72
|
+
* // minHeight: Number("int"),
|
|
73
|
+
* // maxHeight: Number("int"),
|
|
74
|
+
* // dealbreakers: [
|
|
75
|
+
* // "STRING_VALUE",
|
|
76
|
+
* // ],
|
|
77
|
+
* // requirePhoto: true || false,
|
|
78
|
+
* // requireBio: true || false,
|
|
79
|
+
* // requireRecentlyActive: true || false,
|
|
80
|
+
* // recentlyActiveDays: Number("int"),
|
|
81
|
+
* // discoverable: true || false,
|
|
82
|
+
* // incognito: true || false,
|
|
83
|
+
* // distanceUnit: "STRING_VALUE",
|
|
84
|
+
* // notifyMatches: true || false,
|
|
85
|
+
* // notifyLikes: true || false,
|
|
86
|
+
* // notifyDailyPicks: true || false,
|
|
51
87
|
* // };
|
|
52
88
|
*
|
|
53
89
|
* ```
|
|
@@ -66,12 +66,15 @@ declare const GetProfileCommand_base: {
|
|
|
66
66
|
* // pictures: [
|
|
67
67
|
* // "STRING_VALUE",
|
|
68
68
|
* // ],
|
|
69
|
+
* // pictureTransforms: { // StringMap
|
|
70
|
+
* // "<keys>": "STRING_VALUE",
|
|
71
|
+
* // },
|
|
69
72
|
* // videos: [
|
|
70
73
|
* // "STRING_VALUE",
|
|
71
74
|
* // ],
|
|
72
75
|
* // audioPrompt: "STRING_VALUE",
|
|
73
76
|
* // moderationStatus: "STRING_VALUE",
|
|
74
|
-
* // fieldModerationStatus: {
|
|
77
|
+
* // fieldModerationStatus: {
|
|
75
78
|
* // "<keys>": "STRING_VALUE",
|
|
76
79
|
* // },
|
|
77
80
|
* // causes: [
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../OneHookClient";
|
|
2
|
+
import { GetUserIdByUsernameRequest, GetUserIdByUsernameResponse } 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 GetUserIdByUsernameCommand}.
|
|
14
|
+
*/
|
|
15
|
+
export interface GetUserIdByUsernameCommandInput extends GetUserIdByUsernameRequest {
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*
|
|
20
|
+
* The output of {@link GetUserIdByUsernameCommand}.
|
|
21
|
+
*/
|
|
22
|
+
export interface GetUserIdByUsernameCommandOutput extends GetUserIdByUsernameResponse, __MetadataBearer {
|
|
23
|
+
}
|
|
24
|
+
declare const GetUserIdByUsernameCommand_base: {
|
|
25
|
+
new (input: GetUserIdByUsernameCommandInput): import("@smithy/smithy-client").CommandImpl<GetUserIdByUsernameCommandInput, GetUserIdByUsernameCommandOutput, OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
26
|
+
new (__0_0: GetUserIdByUsernameCommandInput): import("@smithy/smithy-client").CommandImpl<GetUserIdByUsernameCommandInput, GetUserIdByUsernameCommandOutput, OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
27
|
+
getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Resolves a public handle to the internal userId. Internal, IAM-authorized (SigV4) — Matching calls
|
|
31
|
+
* it to turn an "add by username" request into a swipe target.
|
|
32
|
+
*
|
|
33
|
+
* DELIBERATELY NOT EXPOSED TO CLIENTS. A handle→userId lookup any signed-in user could call is a
|
|
34
|
+
* username enumeration oracle: it confirms which handles exist and hands out a stable identifier for
|
|
35
|
+
* them. Keeping resolution server-side is what lets the caller-facing swipe-by-username response stay
|
|
36
|
+
* identical whether the handle exists or not.
|
|
37
|
+
* @example
|
|
38
|
+
* Use a bare-bones client and the command you need to make an API call.
|
|
39
|
+
* ```javascript
|
|
40
|
+
* import { OneHookClient, GetUserIdByUsernameCommand } from "onehook-api-client"; // ES Modules import
|
|
41
|
+
* // const { OneHookClient, GetUserIdByUsernameCommand } = require("onehook-api-client"); // CommonJS import
|
|
42
|
+
* const client = new OneHookClient(config);
|
|
43
|
+
* const input = { // GetUserIdByUsernameRequest
|
|
44
|
+
* username: "STRING_VALUE", // required
|
|
45
|
+
* };
|
|
46
|
+
* const command = new GetUserIdByUsernameCommand(input);
|
|
47
|
+
* const response = await client.send(command);
|
|
48
|
+
* // { // GetUserIdByUsernameResponse
|
|
49
|
+
* // userId: "STRING_VALUE", // required
|
|
50
|
+
* // };
|
|
51
|
+
*
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @param GetUserIdByUsernameCommandInput - {@link GetUserIdByUsernameCommandInput}
|
|
55
|
+
* @returns {@link GetUserIdByUsernameCommandOutput}
|
|
56
|
+
* @see {@link GetUserIdByUsernameCommandInput} for command's `input` shape.
|
|
57
|
+
* @see {@link GetUserIdByUsernameCommandOutput} for command's `response` shape.
|
|
58
|
+
* @see {@link OneHookClientResolvedConfig | config} for OneHookClient's `config` shape.
|
|
59
|
+
*
|
|
60
|
+
* @throws {@link BadRequestError} (client fault)
|
|
61
|
+
*
|
|
62
|
+
* @throws {@link NotFoundError} (client fault)
|
|
63
|
+
*
|
|
64
|
+
* @throws {@link InternalServerError} (server fault)
|
|
65
|
+
*
|
|
66
|
+
* @throws {@link OneHookServiceException}
|
|
67
|
+
* <p>Base exception class for all service exceptions from OneHook service.</p>
|
|
68
|
+
*
|
|
69
|
+
*
|
|
70
|
+
* @public
|
|
71
|
+
*/
|
|
72
|
+
export declare class GetUserIdByUsernameCommand extends GetUserIdByUsernameCommand_base {
|
|
73
|
+
/** @internal type navigation helper, not in runtime. */
|
|
74
|
+
protected static __types: {
|
|
75
|
+
api: {
|
|
76
|
+
input: GetUserIdByUsernameRequest;
|
|
77
|
+
output: GetUserIdByUsernameResponse;
|
|
78
|
+
};
|
|
79
|
+
sdk: {
|
|
80
|
+
input: GetUserIdByUsernameCommandInput;
|
|
81
|
+
output: GetUserIdByUsernameCommandOutput;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../OneHookClient";
|
|
2
|
+
import { RegisterPushTokenRequest, RegisterPushTokenResponse } 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 RegisterPushTokenCommand}.
|
|
14
|
+
*/
|
|
15
|
+
export interface RegisterPushTokenCommandInput extends RegisterPushTokenRequest {
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*
|
|
20
|
+
* The output of {@link RegisterPushTokenCommand}.
|
|
21
|
+
*/
|
|
22
|
+
export interface RegisterPushTokenCommandOutput extends RegisterPushTokenResponse, __MetadataBearer {
|
|
23
|
+
}
|
|
24
|
+
declare const RegisterPushTokenCommand_base: {
|
|
25
|
+
new (input: RegisterPushTokenCommandInput): import("@smithy/smithy-client").CommandImpl<RegisterPushTokenCommandInput, RegisterPushTokenCommandOutput, OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
26
|
+
new (__0_0: RegisterPushTokenCommandInput): import("@smithy/smithy-client").CommandImpl<RegisterPushTokenCommandInput, RegisterPushTokenCommandOutput, OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
27
|
+
getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Registers (or refreshes) this device's PUSH token, so notifications can reach the user when the app
|
|
31
|
+
* is CLOSED — which the real-time `onNotification` subscription cannot do, since it needs a live
|
|
32
|
+
* WebSocket.
|
|
33
|
+
*
|
|
34
|
+
* Stored as a `PUSH#<deviceId>` row on the caller's own `DeviceKeyTable` partition, beside the existing
|
|
35
|
+
* `DEVICE#` row. Reusing that partition gives push tokens two behaviours for free: revoking a device
|
|
36
|
+
* can drop its token, and the account-deletion erase already wipes the whole partition, so tokens
|
|
37
|
+
* carry no separate GDPR obligation.
|
|
38
|
+
*
|
|
39
|
+
* Idempotent on `deviceId`: APNs and FCM both rotate tokens, so a refresh must overwrite rather than
|
|
40
|
+
* accumulate — otherwise one device ends up with several live tokens and the user gets duplicates.
|
|
41
|
+
* @example
|
|
42
|
+
* Use a bare-bones client and the command you need to make an API call.
|
|
43
|
+
* ```javascript
|
|
44
|
+
* import { OneHookClient, RegisterPushTokenCommand } from "onehook-api-client"; // ES Modules import
|
|
45
|
+
* // const { OneHookClient, RegisterPushTokenCommand } = require("onehook-api-client"); // CommonJS import
|
|
46
|
+
* const client = new OneHookClient(config);
|
|
47
|
+
* const input = { // RegisterPushTokenRequest
|
|
48
|
+
* deviceId: "STRING_VALUE", // required
|
|
49
|
+
* token: "STRING_VALUE", // required
|
|
50
|
+
* platform: "IOS" || "ANDROID" || "WEB", // required
|
|
51
|
+
* };
|
|
52
|
+
* const command = new RegisterPushTokenCommand(input);
|
|
53
|
+
* const response = await client.send(command);
|
|
54
|
+
* // { // RegisterPushTokenResponse
|
|
55
|
+
* // deviceId: "STRING_VALUE", // required
|
|
56
|
+
* // registered: true || false, // required
|
|
57
|
+
* // };
|
|
58
|
+
*
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* @param RegisterPushTokenCommandInput - {@link RegisterPushTokenCommandInput}
|
|
62
|
+
* @returns {@link RegisterPushTokenCommandOutput}
|
|
63
|
+
* @see {@link RegisterPushTokenCommandInput} for command's `input` shape.
|
|
64
|
+
* @see {@link RegisterPushTokenCommandOutput} for command's `response` shape.
|
|
65
|
+
* @see {@link OneHookClientResolvedConfig | config} for OneHookClient's `config` shape.
|
|
66
|
+
*
|
|
67
|
+
* @throws {@link BadRequestError} (client fault)
|
|
68
|
+
*
|
|
69
|
+
* @throws {@link ForbiddenError} (client fault)
|
|
70
|
+
*
|
|
71
|
+
* @throws {@link NotFoundError} (client fault)
|
|
72
|
+
*
|
|
73
|
+
* @throws {@link InternalServerError} (server fault)
|
|
74
|
+
*
|
|
75
|
+
* @throws {@link OneHookServiceException}
|
|
76
|
+
* <p>Base exception class for all service exceptions from OneHook service.</p>
|
|
77
|
+
*
|
|
78
|
+
*
|
|
79
|
+
* @public
|
|
80
|
+
*/
|
|
81
|
+
export declare class RegisterPushTokenCommand extends RegisterPushTokenCommand_base {
|
|
82
|
+
/** @internal type navigation helper, not in runtime. */
|
|
83
|
+
protected static __types: {
|
|
84
|
+
api: {
|
|
85
|
+
input: RegisterPushTokenRequest;
|
|
86
|
+
output: RegisterPushTokenResponse;
|
|
87
|
+
};
|
|
88
|
+
sdk: {
|
|
89
|
+
input: RegisterPushTokenCommandInput;
|
|
90
|
+
output: RegisterPushTokenCommandOutput;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../OneHookClient";
|
|
2
|
+
import { SwipeByUsernameRequest, SwipeByUsernameResponse } 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 SwipeByUsernameCommand}.
|
|
14
|
+
*/
|
|
15
|
+
export interface SwipeByUsernameCommandInput extends SwipeByUsernameRequest {
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*
|
|
20
|
+
* The output of {@link SwipeByUsernameCommand}.
|
|
21
|
+
*/
|
|
22
|
+
export interface SwipeByUsernameCommandOutput extends SwipeByUsernameResponse, __MetadataBearer {
|
|
23
|
+
}
|
|
24
|
+
declare const SwipeByUsernameCommand_base: {
|
|
25
|
+
new (input: SwipeByUsernameCommandInput): import("@smithy/smithy-client").CommandImpl<SwipeByUsernameCommandInput, SwipeByUsernameCommandOutput, OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
26
|
+
new (__0_0: SwipeByUsernameCommandInput): import("@smithy/smithy-client").CommandImpl<SwipeByUsernameCommandInput, SwipeByUsernameCommandOutput, OneHookClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
27
|
+
getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* "Add by username" — records the caller's RIGHT swipe on whoever owns `username`.
|
|
31
|
+
*
|
|
32
|
+
* This is a LIKE, not a hook. A hook is still only created when the other person likes back (from
|
|
33
|
+
* discovery, or by adding this caller's username in turn), which raises `MutualMatch` and lets State
|
|
34
|
+
* create the Match atomically. That preserves mutual consent and the tier-limited connection count —
|
|
35
|
+
* a one-sided add can neither force a connection nor consume someone's hook slot.
|
|
36
|
+
*
|
|
37
|
+
* ## The response is deliberately uninformative
|
|
38
|
+
* `SwipeByUsernameResponse` carries a single constant status and NOTHING else. It is identical when:
|
|
39
|
+
* * no such username exists,
|
|
40
|
+
* * the username exists and is already hooked (to the caller or anyone else),
|
|
41
|
+
* * the username exists and the like was recorded,
|
|
42
|
+
* * the like was already recorded earlier.
|
|
43
|
+
*
|
|
44
|
+
* So knowing someone's handle reveals nothing about them — not whether they are on OneHook, and not
|
|
45
|
+
* whether they are hooked. Returning `matched` here (as `Swipe` does) would leak exactly that, which
|
|
46
|
+
* is why this operation does not reuse `SwipeResponse`. A resulting match surfaces through the normal
|
|
47
|
+
* match/notification path instead, where both sides have consented.
|
|
48
|
+
* @example
|
|
49
|
+
* Use a bare-bones client and the command you need to make an API call.
|
|
50
|
+
* ```javascript
|
|
51
|
+
* import { OneHookClient, SwipeByUsernameCommand } from "onehook-api-client"; // ES Modules import
|
|
52
|
+
* // const { OneHookClient, SwipeByUsernameCommand } = require("onehook-api-client"); // CommonJS import
|
|
53
|
+
* const client = new OneHookClient(config);
|
|
54
|
+
* const input = { // SwipeByUsernameRequest
|
|
55
|
+
* username: "STRING_VALUE", // required
|
|
56
|
+
* };
|
|
57
|
+
* const command = new SwipeByUsernameCommand(input);
|
|
58
|
+
* const response = await client.send(command);
|
|
59
|
+
* // { // SwipeByUsernameResponse
|
|
60
|
+
* // status: "STRING_VALUE", // required
|
|
61
|
+
* // };
|
|
62
|
+
*
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* @param SwipeByUsernameCommandInput - {@link SwipeByUsernameCommandInput}
|
|
66
|
+
* @returns {@link SwipeByUsernameCommandOutput}
|
|
67
|
+
* @see {@link SwipeByUsernameCommandInput} for command's `input` shape.
|
|
68
|
+
* @see {@link SwipeByUsernameCommandOutput} for command's `response` shape.
|
|
69
|
+
* @see {@link OneHookClientResolvedConfig | config} for OneHookClient's `config` shape.
|
|
70
|
+
*
|
|
71
|
+
* @throws {@link BadRequestError} (client fault)
|
|
72
|
+
*
|
|
73
|
+
* @throws {@link InternalServerError} (server fault)
|
|
74
|
+
*
|
|
75
|
+
* @throws {@link OneHookServiceException}
|
|
76
|
+
* <p>Base exception class for all service exceptions from OneHook service.</p>
|
|
77
|
+
*
|
|
78
|
+
*
|
|
79
|
+
* @public
|
|
80
|
+
*/
|
|
81
|
+
export declare class SwipeByUsernameCommand extends SwipeByUsernameCommand_base {
|
|
82
|
+
/** @internal type navigation helper, not in runtime. */
|
|
83
|
+
protected static __types: {
|
|
84
|
+
api: {
|
|
85
|
+
input: SwipeByUsernameRequest;
|
|
86
|
+
output: SwipeByUsernameResponse;
|
|
87
|
+
};
|
|
88
|
+
sdk: {
|
|
89
|
+
input: SwipeByUsernameCommandInput;
|
|
90
|
+
output: SwipeByUsernameCommandOutput;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
}
|