onehook-api-client 1.0.15 → 1.0.17

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,38 +1,85 @@
1
1
  import { OneHookServiceException as __BaseException } from "./OneHookServiceException";
2
2
  import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client";
3
3
  /**
4
+ * The server's decision about what the model may use for this match. Fails closed:
5
+ * `profileAllowed` / `messageHistoryAllowed` are false unless an active, mutually
6
+ * participating match is confirmed. `policyVersion` lets the caller log and reason about
7
+ * which policy produced the decision.
4
8
  * @public
5
9
  */
6
- export interface CreateMediaDownloadUrlRequest {
7
- matchId: string | undefined;
10
+ export interface AiContextPolicy {
11
+ profileAllowed: boolean | undefined;
12
+ messageHistoryAllowed: boolean | undefined;
13
+ policyVersion: string | undefined;
14
+ }
15
+ /**
16
+ * Allow-listed, AI-visible profile fields. Every field is optional: the server emits only
17
+ * what is present and non-empty, and the contextual-AI backend independently re-sanitises
18
+ * and bounds these on receipt.
19
+ * @public
20
+ */
21
+ export interface AiVisibleProfile {
22
+ displayName?: string | undefined;
23
+ pronouns?: string | undefined;
24
+ bio?: string | undefined;
25
+ interests?: (string)[] | undefined;
26
+ communicationPreferences?: (string)[] | undefined;
27
+ relationshipGoals?: (string)[] | undefined;
28
+ }
29
+ /**
30
+ * @public
31
+ */
32
+ export interface AiContextParticipant {
8
33
  /**
9
- * Must be under `<matchId>/`; anything else is rejected as forbidden.
34
+ * Present only for the requesting participant, as a defence-in-depth echo of the
35
+ * asserted member id. Omitted for the matched participant to avoid disclosing their
36
+ * opaque identifier to the model layer.
10
37
  * @public
11
38
  */
12
- objectKey: string | undefined;
39
+ id?: string | undefined;
40
+ /**
41
+ * Allow-listed, AI-visible profile fields. Every field is optional: the server emits only
42
+ * what is present and non-empty, and the contextual-AI backend independently re-sanitises
43
+ * and bounds these on receipt.
44
+ * @public
45
+ */
46
+ visibleProfile: AiVisibleProfile | undefined;
13
47
  }
14
48
  /**
49
+ * The consent-gated, AI-visible projection of an active match. Mirrors the shape the
50
+ * contextual-AI backend sanitises on receipt: `status` is always "active" (the endpoint
51
+ * 404s otherwise), `requestingUser.id` echoes the asserted member for a defence-in-depth
52
+ * cross-check, and `contextPolicy` carries the server's decision about what the model is
53
+ * allowed to use.
15
54
  * @public
16
55
  */
17
- export interface CreateMediaDownloadUrlResponse {
56
+ export interface AiContextMatch {
57
+ matchId: string | undefined;
58
+ status: string | undefined;
59
+ requestingUser: AiContextParticipant | undefined;
60
+ matchedUser: AiContextParticipant | undefined;
18
61
  /**
19
- * Presigned GET returning ciphertext.
62
+ * The server's decision about what the model may use for this match. Fails closed:
63
+ * `profileAllowed` / `messageHistoryAllowed` are false unless an active, mutually
64
+ * participating match is confirmed. `policyVersion` lets the caller log and reason about
65
+ * which policy produced the decision.
20
66
  * @public
21
67
  */
22
- downloadUrl: string | undefined;
23
- expiresInSeconds: number | undefined;
68
+ contextPolicy: AiContextPolicy | undefined;
24
69
  }
25
70
  /**
26
71
  * @public
27
72
  */
28
- export declare class ForbiddenError extends __BaseException {
29
- readonly name: "ForbiddenError";
30
- readonly $fault: "client";
31
- error: string | undefined;
73
+ export interface GetAiContextMatchRequest {
74
+ matchId: string | undefined;
32
75
  /**
33
- * @internal
76
+ * The acting member, asserted by the trusted caller via the `X-OneHook-User-Id`
77
+ * request header. The endpoint fails closed (404) unless this user is an active
78
+ * participant of the match, so a spoofed value can only ever reference a match the
79
+ * named user is genuinely part of.
80
+ * @public
34
81
  */
35
- constructor(opts: __ExceptionOptionType<ForbiddenError, __BaseException>);
82
+ requestingUserId: string | undefined;
36
83
  }
37
84
  /**
38
85
  * @public
@@ -70,6 +117,40 @@ export declare class NotFoundError extends __BaseException {
70
117
  */
71
118
  constructor(opts: __ExceptionOptionType<NotFoundError, __BaseException>);
72
119
  }
120
+ /**
121
+ * @public
122
+ */
123
+ export interface CreateMediaDownloadUrlRequest {
124
+ matchId: string | undefined;
125
+ /**
126
+ * Must be under `<matchId>/`; anything else is rejected as forbidden.
127
+ * @public
128
+ */
129
+ objectKey: string | undefined;
130
+ }
131
+ /**
132
+ * @public
133
+ */
134
+ export interface CreateMediaDownloadUrlResponse {
135
+ /**
136
+ * Presigned GET returning ciphertext.
137
+ * @public
138
+ */
139
+ downloadUrl: string | undefined;
140
+ expiresInSeconds: number | undefined;
141
+ }
142
+ /**
143
+ * @public
144
+ */
145
+ export declare class ForbiddenError extends __BaseException {
146
+ readonly name: "ForbiddenError";
147
+ readonly $fault: "client";
148
+ error: string | undefined;
149
+ /**
150
+ * @internal
151
+ */
152
+ constructor(opts: __ExceptionOptionType<ForbiddenError, __BaseException>);
153
+ }
73
154
  /**
74
155
  * @public
75
156
  * @enum
@@ -883,6 +964,71 @@ export interface UserPreferencesResponse {
883
964
  notifyLikes?: boolean | undefined;
884
965
  notifyDailyPicks?: boolean | undefined;
885
966
  }
967
+ /**
968
+ * One received, still-pending like: who sent it, the comment they left, and which profile element
969
+ * it was attached to.
970
+ * @public
971
+ */
972
+ export interface ReceivedLike {
973
+ /**
974
+ * The user who liked the caller.
975
+ * @public
976
+ */
977
+ fromUserId: string | undefined;
978
+ /**
979
+ * The liker's comment. NULL only for a `SwipeByUsername` like (recorded with no profile element
980
+ * in view), which carries no comment.
981
+ * @public
982
+ */
983
+ comment?: string | undefined;
984
+ /**
985
+ * The KIND of element the comment is attached to: PHOTO | VIDEO | PROMPT | INTEREST | BIO |
986
+ * VOICE. NULL for a `SwipeByUsername` like.
987
+ * @public
988
+ */
989
+ likeTargetType?: string | undefined;
990
+ /**
991
+ * Which specific element the comment is attached to (media key / promptId / interest value /
992
+ * "bio"), per `likeTargetType`. NULL for a `SwipeByUsername` like.
993
+ * @public
994
+ */
995
+ likeTargetRef?: string | undefined;
996
+ /**
997
+ * When the like was recorded, ISO-8601 (UTC).
998
+ * @public
999
+ */
1000
+ createdAt: string | undefined;
1001
+ }
1002
+ /**
1003
+ * The pending likes the caller has received, newest first, plus their count. See
1004
+ * `GetReceivedLikes`.
1005
+ * @public
1006
+ */
1007
+ export interface GetReceivedLikesResponse {
1008
+ likes: (ReceivedLike)[] | undefined;
1009
+ count: number | undefined;
1010
+ }
1011
+ /**
1012
+ * The caller's rose availability for the current UTC day. See `GetRoses`.
1013
+ * @public
1014
+ */
1015
+ export interface GetRosesResponse {
1016
+ /**
1017
+ * Roses the caller may still send today (never negative).
1018
+ * @public
1019
+ */
1020
+ remaining: number | undefined;
1021
+ /**
1022
+ * The caller's per-day rose allowance, from their stored tier (Must=1, Super=3, Infinity=10).
1023
+ * @public
1024
+ */
1025
+ limit: number | undefined;
1026
+ /**
1027
+ * The next UTC midnight (ISO-8601), when `remaining` resets to `limit`.
1028
+ * @public
1029
+ */
1030
+ resetsAt: string | undefined;
1031
+ }
886
1032
  /**
887
1033
  * @public
888
1034
  */
@@ -910,6 +1056,54 @@ export interface SwipeRequest {
910
1056
  * @public
911
1057
  */
912
1058
  viewedSection?: string | undefined;
1059
+ /**
1060
+ * The like's comment. In the Hinge-style model a like is never bare — it must carry a comment
1061
+ * attached to a specific element of the target's profile.
1062
+ *
1063
+ * REQUIRED when `direction == RIGHT`: a RIGHT swipe with a blank/missing `comment` is rejected
1064
+ * (HTTP 400). Trimmed server-side and capped at 500 characters (longer is rejected).
1065
+ *
1066
+ * MUST be absent for `direction == LEFT` (a pass). Any value a client sends on a LEFT swipe is
1067
+ * IGNORED and never persisted. (`SwipeByUsername` is the one exempt like-path — it records a
1068
+ * like with no profile element in view and therefore no comment.)
1069
+ * @public
1070
+ */
1071
+ comment?: string | undefined;
1072
+ /**
1073
+ * Which KIND of profile element the `comment` is attached to. REQUIRED (and validated against
1074
+ * the allowlist) when `direction == RIGHT`; an unknown value is rejected (HTTP 400). Ignored on
1075
+ * a LEFT swipe.
1076
+ *
1077
+ * Valid values: PHOTO | VIDEO | PROMPT | INTEREST | BIO | VOICE.
1078
+ * @public
1079
+ */
1080
+ likeTargetType?: string | undefined;
1081
+ /**
1082
+ * Which SPECIFIC element the `comment` is attached to, interpreted per `likeTargetType`:
1083
+ * * PHOTO / VIDEO / VOICE → the media object key,
1084
+ * * PROMPT → the promptId,
1085
+ * * INTEREST → the interest value,
1086
+ * * BIO → not needed (empty or the literal "bio").
1087
+ *
1088
+ * REQUIRED for every `likeTargetType` EXCEPT BIO when `direction == RIGHT`. Ignored on a LEFT
1089
+ * swipe. Capped at 512 characters.
1090
+ * @public
1091
+ */
1092
+ likeTargetRef?: string | undefined;
1093
+ /**
1094
+ * The KIND of like this swipe records. Optional; defaults to "LIKE" when absent.
1095
+ *
1096
+ * Valid values: "LIKE" (an ordinary like) | "ROSE" (a premium, daily-limited like). Validated
1097
+ * server-side against that allowlist — an unknown value is rejected (HTTP 400).
1098
+ *
1099
+ * A ROSE is still a LIKE for matching purposes: a reciprocated rose creates a match exactly as a
1100
+ * like does. It must accompany a RIGHT swipe, and it is subject to a per-tier DAILY QUOTA
1101
+ * (Must=1, Super=3, Infinity=10) enforced server-side from the caller's STORED subscription tier —
1102
+ * never a tier value sent by the client. Over quota returns HTTP 429. The tier-aware comment rules
1103
+ * are identical to an ordinary like (Must must write >= 10 words; Super/Infinity may send none).
1104
+ * @public
1105
+ */
1106
+ likeKind?: string | undefined;
913
1107
  }
914
1108
  /**
915
1109
  * @public
@@ -11,6 +11,7 @@ import { DiscoverCommandInput, DiscoverCommandOutput } from "../commands/Discove
11
11
  import { GenerateDownloadUrlCommandInput, GenerateDownloadUrlCommandOutput } from "../commands/GenerateDownloadUrlCommand";
12
12
  import { GenerateInviteCommandInput, GenerateInviteCommandOutput } from "../commands/GenerateInviteCommand";
13
13
  import { GenerateUploadUrlCommandInput, GenerateUploadUrlCommandOutput } from "../commands/GenerateUploadUrlCommand";
14
+ import { GetAiContextMatchCommandInput, GetAiContextMatchCommandOutput } from "../commands/GetAiContextMatchCommand";
14
15
  import { GetChatSettingsCommandInput, GetChatSettingsCommandOutput } from "../commands/GetChatSettingsCommand";
15
16
  import { GetCredentialReadinessCommandInput, GetCredentialReadinessCommandOutput } from "../commands/GetCredentialReadinessCommand";
16
17
  import { GetLivenessStatusCommandInput, GetLivenessStatusCommandOutput } from "../commands/GetLivenessStatusCommand";
@@ -20,6 +21,8 @@ import { GetNotificationPreferencesCommandInput, GetNotificationPreferencesComma
20
21
  import { GetParticipantRegistryCommandInput, GetParticipantRegistryCommandOutput } from "../commands/GetParticipantRegistryCommand";
21
22
  import { GetPreferencesCommandInput, GetPreferencesCommandOutput } from "../commands/GetPreferencesCommand";
22
23
  import { GetProfileCommandInput, GetProfileCommandOutput } from "../commands/GetProfileCommand";
24
+ import { GetReceivedLikesCommandInput, GetReceivedLikesCommandOutput } from "../commands/GetReceivedLikesCommand";
25
+ import { GetRosesCommandInput, GetRosesCommandOutput } from "../commands/GetRosesCommand";
23
26
  import { GetStateCommandInput, GetStateCommandOutput } from "../commands/GetStateCommand";
24
27
  import { GetUserByEmailCommandInput, GetUserByEmailCommandOutput } from "../commands/GetUserByEmailCommand";
25
28
  import { GetUserCommandInput, GetUserCommandOutput } from "../commands/GetUserCommand";
@@ -51,6 +54,10 @@ import { UpgradeUserCommandInput, UpgradeUserCommandOutput } from "../commands/U
51
54
  import { ValidateInviteCommandInput, ValidateInviteCommandOutput } from "../commands/ValidateInviteCommand";
52
55
  import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
53
56
  import { SerdeContext as __SerdeContext } from "@smithy/types";
57
+ /**
58
+ * serializeAws_restJson1GetAiContextMatchCommand
59
+ */
60
+ export declare const se_GetAiContextMatchCommand: (input: GetAiContextMatchCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
54
61
  /**
55
62
  * serializeAws_restJson1CreateMediaDownloadUrlCommand
56
63
  */
@@ -175,6 +182,14 @@ export declare const se_GetNotificationPreferencesCommand: (input: GetNotificati
175
182
  * serializeAws_restJson1GetPreferencesCommand
176
183
  */
177
184
  export declare const se_GetPreferencesCommand: (input: GetPreferencesCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
185
+ /**
186
+ * serializeAws_restJson1GetReceivedLikesCommand
187
+ */
188
+ export declare const se_GetReceivedLikesCommand: (input: GetReceivedLikesCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
189
+ /**
190
+ * serializeAws_restJson1GetRosesCommand
191
+ */
192
+ export declare const se_GetRosesCommand: (input: GetRosesCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
178
193
  /**
179
194
  * serializeAws_restJson1IndexLocationCommand
180
195
  */
@@ -255,6 +270,10 @@ export declare const se_UnhookCommand: (input: UnhookCommandInput, context: __Se
255
270
  * serializeAws_restJson1UpgradeUserCommand
256
271
  */
257
272
  export declare const se_UpgradeUserCommand: (input: UpgradeUserCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
273
+ /**
274
+ * deserializeAws_restJson1GetAiContextMatchCommand
275
+ */
276
+ export declare const de_GetAiContextMatchCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<GetAiContextMatchCommandOutput>;
258
277
  /**
259
278
  * deserializeAws_restJson1CreateMediaDownloadUrlCommand
260
279
  */
@@ -379,6 +398,14 @@ export declare const de_GetNotificationPreferencesCommand: (output: __HttpRespon
379
398
  * deserializeAws_restJson1GetPreferencesCommand
380
399
  */
381
400
  export declare const de_GetPreferencesCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<GetPreferencesCommandOutput>;
401
+ /**
402
+ * deserializeAws_restJson1GetReceivedLikesCommand
403
+ */
404
+ export declare const de_GetReceivedLikesCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<GetReceivedLikesCommandOutput>;
405
+ /**
406
+ * deserializeAws_restJson1GetRosesCommand
407
+ */
408
+ export declare const de_GetRosesCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<GetRosesCommandOutput>;
382
409
  /**
383
410
  * deserializeAws_restJson1IndexLocationCommand
384
411
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "onehook-api-client",
3
3
  "description": "OneHook API Client",
4
- "version": "1.0.15",
4
+ "version": "1.0.17",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",