@amityco/ts-sdk 7.29.0 → 7.29.1-c2a29dc.0
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/dist/@types/core/errors.d.ts +4 -1
- package/dist/@types/core/errors.d.ts.map +1 -1
- package/dist/@types/domains/channel.d.ts +13 -1
- package/dist/@types/domains/channel.d.ts.map +1 -1
- package/dist/@types/domains/content.d.ts +11 -0
- package/dist/@types/domains/content.d.ts.map +1 -1
- package/dist/@types/domains/user.d.ts +75 -0
- package/dist/@types/domains/user.d.ts.map +1 -1
- package/dist/channelRepository/observers/getChannels/ChannelLiveCollectionController.d.ts.map +1 -1
- package/dist/channelRepository/observers/searchChannels/SearchChannelLiveCollectionController.d.ts.map +1 -1
- package/dist/channelRepository/observers/tests/integrations/getChannelsSortByLastMessage.integration.test.d.ts +2 -0
- package/dist/channelRepository/observers/tests/integrations/getChannelsSortByLastMessage.integration.test.d.ts.map +1 -0
- package/dist/channelRepository/utils/channelActivityOnLoginHandler.d.ts +16 -0
- package/dist/channelRepository/utils/channelActivityOnLoginHandler.d.ts.map +1 -0
- package/dist/channelRepository/utils/tests/integrations/channelActivity.integration.test.d.ts +2 -0
- package/dist/channelRepository/utils/tests/integrations/channelActivity.integration.test.d.ts.map +1 -0
- package/dist/channelRepository/utils/tests/updateChannelActivityTimestamps.test.d.ts +2 -0
- package/dist/channelRepository/utils/tests/updateChannelActivityTimestamps.test.d.ts.map +1 -0
- package/dist/channelRepository/utils/updateChannelActivityTimestamps.d.ts +42 -0
- package/dist/channelRepository/utils/updateChannelActivityTimestamps.d.ts.map +1 -0
- package/dist/client/api/resumeSession.d.ts.map +1 -1
- package/dist/client/api/setupLoginSubscriptions.d.ts.map +1 -1
- package/dist/commentRepository/api/flagComment.d.ts +72 -5
- package/dist/commentRepository/api/flagComment.d.ts.map +1 -1
- package/dist/commentRepository/internalApi/flagCommentWithOptions.d.ts +13 -0
- package/dist/commentRepository/internalApi/flagCommentWithOptions.d.ts.map +1 -0
- package/dist/commentRepository/internalApi/flagCommentWithReasonString.d.ts +17 -0
- package/dist/commentRepository/internalApi/flagCommentWithReasonString.d.ts.map +1 -0
- package/dist/commentRepository/internalApi/index.d.ts +2 -0
- package/dist/commentRepository/internalApi/index.d.ts.map +1 -1
- package/dist/commentRepository/internalApi/tests/integration/flagCommentWithOptions.integration.test.d.ts +2 -0
- package/dist/commentRepository/internalApi/tests/integration/flagCommentWithOptions.integration.test.d.ts.map +1 -0
- package/dist/commentRepository/internalApi/tests/integration/flagCommentWithReasonString.integration.test.d.ts +2 -0
- package/dist/commentRepository/internalApi/tests/integration/flagCommentWithReasonString.integration.test.d.ts.map +1 -0
- package/dist/core/microtasks.d.ts.map +1 -1
- package/dist/core/query/sorting.d.ts +10 -0
- package/dist/core/query/sorting.d.ts.map +1 -1
- package/dist/core/query/tests/sorting.test.d.ts +2 -0
- package/dist/core/query/tests/sorting.test.d.ts.map +1 -0
- package/dist/core/tests/microtasks.test.d.ts +2 -0
- package/dist/core/tests/microtasks.test.d.ts.map +1 -0
- package/dist/core/transports/tests/integration/serverErrorCodes.integration.test.d.ts +2 -0
- package/dist/core/transports/tests/integration/serverErrorCodes.integration.test.d.ts.map +1 -0
- package/dist/index.cjs.js +726 -81
- package/dist/index.esm.js +726 -82
- package/dist/index.umd.js +2 -2
- package/dist/messagePreview/utils/getChannelMessagePreviewWithUser.d.ts +1 -0
- package/dist/messagePreview/utils/getChannelMessagePreviewWithUser.d.ts.map +1 -1
- package/dist/messageRepository/api/createMessage.d.ts.map +1 -1
- package/dist/messageRepository/api/flagMessage.d.ts +73 -6
- package/dist/messageRepository/api/flagMessage.d.ts.map +1 -1
- package/dist/messageRepository/api/tests/integration/flagMessage.overloads.integration.test.d.ts +2 -0
- package/dist/messageRepository/api/tests/integration/flagMessage.overloads.integration.test.d.ts.map +1 -0
- package/dist/messageRepository/internalApi/flagMessageWithOptions.d.ts +13 -0
- package/dist/messageRepository/internalApi/flagMessageWithOptions.d.ts.map +1 -0
- package/dist/messageRepository/internalApi/flagMessageWithReasonString.d.ts +18 -0
- package/dist/messageRepository/internalApi/flagMessageWithReasonString.d.ts.map +1 -0
- package/dist/messageRepository/internalApi/tests/integration/flagMessageWithOptions.integration.test.d.ts +2 -0
- package/dist/messageRepository/internalApi/tests/integration/flagMessageWithOptions.integration.test.d.ts.map +1 -0
- package/dist/messageRepository/internalApi/tests/integration/flagMessageWithReasonString.integration.test.d.ts +2 -0
- package/dist/messageRepository/internalApi/tests/integration/flagMessageWithReasonString.integration.test.d.ts.map +1 -0
- package/dist/postRepository/api/flagPost.d.ts +73 -6
- package/dist/postRepository/api/flagPost.d.ts.map +1 -1
- package/dist/postRepository/api/tests/integration/flagPost.overloads.integration.test.d.ts +2 -0
- package/dist/postRepository/api/tests/integration/flagPost.overloads.integration.test.d.ts.map +1 -0
- package/dist/postRepository/internalApi/flagPostWithOptions.d.ts +13 -0
- package/dist/postRepository/internalApi/flagPostWithOptions.d.ts.map +1 -0
- package/dist/postRepository/internalApi/flagPostWithReasonString.d.ts +17 -0
- package/dist/postRepository/internalApi/flagPostWithReasonString.d.ts.map +1 -0
- package/dist/postRepository/internalApi/index.d.ts +2 -0
- package/dist/postRepository/internalApi/index.d.ts.map +1 -1
- package/dist/postRepository/internalApi/tests/integration/flagPostWithOptions.integration.test.d.ts +2 -0
- package/dist/postRepository/internalApi/tests/integration/flagPostWithOptions.integration.test.d.ts.map +1 -0
- package/dist/postRepository/internalApi/tests/integration/flagPostWithReasonString.integration.test.d.ts +2 -0
- package/dist/postRepository/internalApi/tests/integration/flagPostWithReasonString.integration.test.d.ts.map +1 -0
- package/dist/report/api/isReportedByMe.d.ts.map +1 -1
- package/dist/userRepository/api/flagUser.d.ts +50 -9
- package/dist/userRepository/api/flagUser.d.ts.map +1 -1
- package/dist/userRepository/api/flagUserBehavior.d.ts +29 -0
- package/dist/userRepository/api/flagUserBehavior.d.ts.map +1 -0
- package/dist/userRepository/api/flagUserProfile.d.ts +29 -0
- package/dist/userRepository/api/flagUserProfile.d.ts.map +1 -0
- package/dist/userRepository/api/index.d.ts +2 -0
- package/dist/userRepository/api/index.d.ts.map +1 -1
- package/dist/userRepository/api/isUserFlaggedByMe.d.ts +22 -4
- package/dist/userRepository/api/isUserFlaggedByMe.d.ts.map +1 -1
- package/dist/userRepository/api/tests/integration/flagUser.overloads.integration.test.d.ts +2 -0
- package/dist/userRepository/api/tests/integration/flagUser.overloads.integration.test.d.ts.map +1 -0
- package/dist/userRepository/api/tests/integration/flagUserBehavior.integration.test.d.ts +2 -0
- package/dist/userRepository/api/tests/integration/flagUserBehavior.integration.test.d.ts.map +1 -0
- package/dist/userRepository/api/tests/integration/flagUserProfile.integration.test.d.ts +2 -0
- package/dist/userRepository/api/tests/integration/flagUserProfile.integration.test.d.ts.map +1 -0
- package/dist/userRepository/api/unflagUser.d.ts +26 -4
- package/dist/userRepository/api/unflagUser.d.ts.map +1 -1
- package/dist/userRepository/utils/submitUserReport.d.ts +10 -0
- package/dist/userRepository/utils/submitUserReport.d.ts.map +1 -0
- package/dist/userRepository/utils/userReport.d.ts +50 -0
- package/dist/userRepository/utils/userReport.d.ts.map +1 -0
- package/dist/utils/contentFlag.d.ts +28 -0
- package/dist/utils/contentFlag.d.ts.map +1 -0
- package/dist/utils/tests/dummy/channel.d.ts +4 -0
- package/dist/utils/tests/dummy/channel.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -23,6 +23,7 @@ export declare const getChannelMessagePreviewWithUser: (channel: Amity.StaticInt
|
|
|
23
23
|
pinnedMessage?: Amity.RawPinnedMessage<any> | null | undefined;
|
|
24
24
|
isPublic?: boolean | undefined;
|
|
25
25
|
lastActivity: string;
|
|
26
|
+
lastMessageAt: string | null;
|
|
26
27
|
attachedTo?: {
|
|
27
28
|
postId?: string | undefined;
|
|
28
29
|
videoStreamId?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getChannelMessagePreviewWithUser.d.ts","sourceRoot":"","sources":["../../../src/messagePreview/utils/getChannelMessagePreviewWithUser.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gCAAgC,YAClC,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"getChannelMessagePreviewWithUser.d.ts","sourceRoot":"","sources":["../../../src/messagePreview/utils/getChannelMessagePreviewWithUser.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gCAAgC,YAClC,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAEpB,MAAM,cAAc,GAAG,IAAI;CAoB5C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createMessage.d.ts","sourceRoot":"","sources":["../../../src/messageRepository/api/createMessage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createMessage.d.ts","sourceRoot":"","sources":["../../../src/messageRepository/api/createMessage.ts"],"names":[],"mappings":"AAwBA,aAAK,kBAAkB,CAAC,CAAC,SAAS,KAAK,CAAC,kBAAkB,IAAI,IAAI,CAChE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAChB,cAAc,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,YAAY,CAC9E,GAAG;IACF,IAAI,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAiFF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,aAAa,yEAEvB,QAAQ,MAAM,MAAM,CAAC,MAAM,OAAO,CAAC,CA2CrC,CAAC"}
|
|
@@ -1,15 +1,82 @@
|
|
|
1
|
+
declare type FlagMessage = {
|
|
2
|
+
/**
|
|
3
|
+
* ```js
|
|
4
|
+
* import { MessageRepository } from '@amityco/ts-sdk'
|
|
5
|
+
* const flagged = await MessageRepository.flagMessage(messageId)
|
|
6
|
+
* ```
|
|
7
|
+
*
|
|
8
|
+
* Flags a message without a reason. The report is sent as `Others`; no detail is serialized.
|
|
9
|
+
*
|
|
10
|
+
* @param messageId The ID of the message to flag
|
|
11
|
+
* @returns `true` when the report was created
|
|
12
|
+
*/
|
|
13
|
+
(messageId: Amity.Message['messageId'], reason?: undefined): Promise<boolean>;
|
|
14
|
+
/**
|
|
15
|
+
* ```js
|
|
16
|
+
* import { MessageRepository, ContentFlagReasonEnum } from '@amityco/ts-sdk'
|
|
17
|
+
* const flagged = await MessageRepository.flagMessage(messageId, {
|
|
18
|
+
* reason: ContentFlagReasonEnum.SpamOrScams,
|
|
19
|
+
* detail: 'Repeated promotional links',
|
|
20
|
+
* })
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* Flags a message with a category and optional reporter context. Any category,
|
|
24
|
+
* including `Others`, may carry a `detail`. `detail` is sent unchanged and omitted
|
|
25
|
+
* when not supplied; the backend enforces its 300-character limit.
|
|
26
|
+
*
|
|
27
|
+
* @param messageId The ID of the message to flag
|
|
28
|
+
* @param options `reason` is a `ContentFlagReasonEnum` value; `detail` is optional free text
|
|
29
|
+
* @returns `true` when the report was created
|
|
30
|
+
* @throws {ASCInvalidParameterError} `INVALID_PARAMETERS` when `options` is malformed, before any request is made
|
|
31
|
+
*/
|
|
32
|
+
(messageId: Amity.Message['messageId'], options: Amity.ContentFlagOptions): Promise<boolean>;
|
|
33
|
+
/**
|
|
34
|
+
* ```js
|
|
35
|
+
* import { MessageRepository } from '@amityco/ts-sdk'
|
|
36
|
+
* const flagged = await MessageRepository.flagMessage(messageId, reason)
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @deprecated Pass an options object instead: `flagMessage(messageId, { reason, detail })`.
|
|
40
|
+
* A predefined string maps to `{ reason: <value>, detail: '' }`; a custom string maps to
|
|
41
|
+
* `{ reason: 'Others', detail: <string> }`. Migrate a custom string to
|
|
42
|
+
* `{ reason: ContentFlagReasonEnum.Others, detail: customString }`. This mapping is
|
|
43
|
+
* unchanged and stays available throughout the current major version.
|
|
44
|
+
*
|
|
45
|
+
* @param messageId The ID of the message to flag
|
|
46
|
+
* @param reason a predefined `ContentFlagReasonEnum` value or a custom string
|
|
47
|
+
* @returns `true` when the report was created
|
|
48
|
+
*/
|
|
49
|
+
(messageId: Amity.Message['messageId'], reason?: Amity.ContentFlagReason): Promise<boolean>;
|
|
50
|
+
};
|
|
1
51
|
/**
|
|
2
52
|
* ```js
|
|
3
|
-
* import { MessageRepository } from '@amityco/ts-sdk'
|
|
4
|
-
*
|
|
53
|
+
* import { MessageRepository, ContentFlagReasonEnum } from '@amityco/ts-sdk'
|
|
54
|
+
*
|
|
55
|
+
* // No reason.
|
|
56
|
+
* await MessageRepository.flagMessage(messageId)
|
|
57
|
+
*
|
|
58
|
+
* // Category plus optional reporter context (any category, including Others).
|
|
59
|
+
* await MessageRepository.flagMessage(messageId, {
|
|
60
|
+
* reason: ContentFlagReasonEnum.SpamOrScams,
|
|
61
|
+
* detail: 'Repeated promotional links',
|
|
62
|
+
* })
|
|
5
63
|
* ```
|
|
6
64
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
65
|
+
* Reports a message to moderation. Three call shapes are accepted (see the overloads):
|
|
66
|
+
* id-only, an options object, and the deprecated legacy reason string. The public
|
|
67
|
+
* name only dispatches on the input shape; the two implementations are kept separate
|
|
68
|
+
* so the legacy path is untouched by the new contract:
|
|
69
|
+
*
|
|
70
|
+
* - `undefined` or a string → `flagMessageWithReasonString` (unchanged legacy mapping)
|
|
71
|
+
* - anything else → `flagMessageWithOptions` (validated `{ reason, detail? }`)
|
|
72
|
+
*
|
|
73
|
+
* @param messageId The ID of the message to flag
|
|
74
|
+
* @param input an options object `{ reason, detail? }`, a legacy reason string, or nothing
|
|
75
|
+
* @returns `true` when the report was created
|
|
10
76
|
*
|
|
11
77
|
* @category Message API
|
|
12
78
|
* @async
|
|
13
79
|
* */
|
|
14
|
-
export declare const flagMessage:
|
|
80
|
+
export declare const flagMessage: FlagMessage;
|
|
81
|
+
export {};
|
|
15
82
|
//# sourceMappingURL=flagMessage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flagMessage.d.ts","sourceRoot":"","sources":["../../../src/messageRepository/api/flagMessage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flagMessage.d.ts","sourceRoot":"","sources":["../../../src/messageRepository/api/flagMessage.ts"],"names":[],"mappings":"AAIA,aAAK,WAAW,GAAG;IACjB;;;;;;;;;;OAUG;IACH,CAAC,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9E;;;;;;;;;;;;;;;;;OAiBG;IACH,CAAC,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7F;;;;;;;;;;;;;;;OAeG;IACH,CAAC,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC7F,CAAC;AAKF;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4BK;AACL,eAAO,MAAM,WAAW,EAAE,WAMoB,CAAC"}
|
package/dist/messageRepository/api/tests/integration/flagMessage.overloads.integration.test.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flagMessage.overloads.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/messageRepository/api/tests/integration/flagMessage.overloads.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* New `flagMessage(messageId, { reason, detail? })` implementation. Any category,
|
|
3
|
+
* including `Others`, may carry a `detail`. `detail` is forwarded unchanged (empty and
|
|
4
|
+
* whitespace-only strings included) and omitted from the request body when `undefined`;
|
|
5
|
+
* the backend enforces the 300-character limit.
|
|
6
|
+
*
|
|
7
|
+
* Not exported from the public API. It is reached through the
|
|
8
|
+
* `MessageRepository.flagMessage(messageId, options)` overload; see `api/flagMessage.ts`.
|
|
9
|
+
*
|
|
10
|
+
* @throws {ASCInvalidParameterError} `INVALID_PARAMETERS` when `options` is malformed, before any request is made
|
|
11
|
+
*/
|
|
12
|
+
export declare const flagMessageWithOptions: (messageId: Amity.Message['messageId'], options: Amity.ContentFlagOptions) => Promise<boolean>;
|
|
13
|
+
//# sourceMappingURL=flagMessageWithOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flagMessageWithOptions.d.ts","sourceRoot":"","sources":["../../../src/messageRepository/internalApi/flagMessageWithOptions.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,cACtB,MAAM,OAAO,CAAC,WAAW,CAAC,WAC5B,MAAM,kBAAkB,KAChC,QAAQ,OAAO,CAqBjB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Legacy `flagMessage(messageId, reason?)` implementation, kept verbatim so existing
|
|
3
|
+
* callers keep the exact request body they had before the options contract existed:
|
|
4
|
+
*
|
|
5
|
+
* - predefined `ContentFlagReasonEnum` value → `{ reason: <value>, detail: '' }`
|
|
6
|
+
* - any other non-empty string (including the literal `'Others'`) → `{ reason: 'Others', detail: <string> }`
|
|
7
|
+
* - `undefined` or `''` → `{ reason: 'Others', detail: '' }`
|
|
8
|
+
* (for `undefined` the message body carries `detail: undefined`, which JSON serialization omits)
|
|
9
|
+
*
|
|
10
|
+
* Not exported from the public API. It is reached through the deprecated
|
|
11
|
+
* `MessageRepository.flagMessage(messageId, reason)` overload; see `api/flagMessage.ts`.
|
|
12
|
+
*
|
|
13
|
+
* Not itself deprecated: it implements the deprecated legacy-string overload of the public
|
|
14
|
+
* `flagMessage`, which carries the deprecation tag. New code should use `flagMessageWithOptions`
|
|
15
|
+
* (the `{ reason, detail? }` contract). This path stays available throughout the current major version.
|
|
16
|
+
*/
|
|
17
|
+
export declare const flagMessageWithReasonString: (messageId: Amity.Message['messageId'], reason?: Amity.ContentFlagReason) => Promise<boolean>;
|
|
18
|
+
//# sourceMappingURL=flagMessageWithReasonString.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flagMessageWithReasonString.d.ts","sourceRoot":"","sources":["../../../src/messageRepository/internalApi/flagMessageWithReasonString.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,2BAA2B,cAC3B,MAAM,OAAO,CAAC,WAAW,CAAC,WAC5B,MAAM,iBAAiB,KAC/B,QAAQ,OAAO,CA4BjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flagMessageWithOptions.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/messageRepository/internalApi/tests/integration/flagMessageWithOptions.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flagMessageWithReasonString.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/messageRepository/internalApi/tests/integration/flagMessageWithReasonString.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,15 +1,82 @@
|
|
|
1
|
+
declare type FlagPost = {
|
|
2
|
+
/**
|
|
3
|
+
* ```js
|
|
4
|
+
* import { PostRepository } from '@amityco/ts-sdk'
|
|
5
|
+
* const flagged = await PostRepository.flagPost(postId)
|
|
6
|
+
* ```
|
|
7
|
+
*
|
|
8
|
+
* Flags a post without a reason. The report is sent as `Others` with an empty detail.
|
|
9
|
+
*
|
|
10
|
+
* @param postId The ID of the post to flag
|
|
11
|
+
* @returns `true` when the report was created
|
|
12
|
+
*/
|
|
13
|
+
(postId: Amity.Post['postId'], reason?: undefined): Promise<boolean>;
|
|
14
|
+
/**
|
|
15
|
+
* ```js
|
|
16
|
+
* import { PostRepository, ContentFlagReasonEnum } from '@amityco/ts-sdk'
|
|
17
|
+
* const flagged = await PostRepository.flagPost(postId, {
|
|
18
|
+
* reason: ContentFlagReasonEnum.SpamOrScams,
|
|
19
|
+
* detail: 'Repeated promotional links',
|
|
20
|
+
* })
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* Flags a post with a category and optional reporter context. Any category,
|
|
24
|
+
* including `Others`, may carry a `detail`. `detail` is sent unchanged and omitted
|
|
25
|
+
* when not supplied; the backend enforces its 300-character limit.
|
|
26
|
+
*
|
|
27
|
+
* @param postId The ID of the post to flag
|
|
28
|
+
* @param options `reason` is a `ContentFlagReasonEnum` value; `detail` is optional free text
|
|
29
|
+
* @returns `true` when the report was created
|
|
30
|
+
* @throws {ASCInvalidParameterError} `INVALID_PARAMETERS` when `options` is malformed, before any request is made
|
|
31
|
+
*/
|
|
32
|
+
(postId: Amity.Post['postId'], options: Amity.ContentFlagOptions): Promise<boolean>;
|
|
33
|
+
/**
|
|
34
|
+
* ```js
|
|
35
|
+
* import { PostRepository } from '@amityco/ts-sdk'
|
|
36
|
+
* const flagged = await PostRepository.flagPost(postId, reason)
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @deprecated Pass an options object instead: `flagPost(postId, { reason, detail })`.
|
|
40
|
+
* A predefined string maps to `{ reason: <value>, detail: '' }`; a custom string maps to
|
|
41
|
+
* `{ reason: 'Others', detail: <string> }`. Migrate a custom string to
|
|
42
|
+
* `{ reason: ContentFlagReasonEnum.Others, detail: customString }`. This mapping is
|
|
43
|
+
* unchanged and stays available throughout the current major version.
|
|
44
|
+
*
|
|
45
|
+
* @param postId The ID of the post to flag
|
|
46
|
+
* @param reason a predefined `ContentFlagReasonEnum` value or a custom string
|
|
47
|
+
* @returns `true` when the report was created
|
|
48
|
+
*/
|
|
49
|
+
(postId: Amity.Post['postId'], reason?: Amity.ContentFlagReason): Promise<boolean>;
|
|
50
|
+
};
|
|
1
51
|
/**
|
|
2
52
|
* ```js
|
|
3
|
-
* import { PostRepository } from '@amityco/ts-sdk'
|
|
4
|
-
*
|
|
53
|
+
* import { PostRepository, ContentFlagReasonEnum } from '@amityco/ts-sdk'
|
|
54
|
+
*
|
|
55
|
+
* // No reason.
|
|
56
|
+
* await PostRepository.flagPost(postId)
|
|
57
|
+
*
|
|
58
|
+
* // Category plus optional reporter context (any category, including Others).
|
|
59
|
+
* await PostRepository.flagPost(postId, {
|
|
60
|
+
* reason: ContentFlagReasonEnum.SpamOrScams,
|
|
61
|
+
* detail: 'Repeated promotional links',
|
|
62
|
+
* })
|
|
5
63
|
* ```
|
|
6
64
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
65
|
+
* Reports a post to moderation. Three call shapes are accepted (see the overloads):
|
|
66
|
+
* id-only, an options object, and the deprecated legacy reason string. The public
|
|
67
|
+
* name only dispatches on the input shape; the two implementations are kept separate
|
|
68
|
+
* so the legacy path is untouched by the new contract:
|
|
69
|
+
*
|
|
70
|
+
* - `undefined` or a string → `flagPostWithReasonString` (unchanged legacy mapping)
|
|
71
|
+
* - anything else → `flagPostWithOptions` (validated `{ reason, detail? }`)
|
|
72
|
+
*
|
|
73
|
+
* @param postId The ID of the post to flag
|
|
74
|
+
* @param input an options object `{ reason, detail? }`, a legacy reason string, or nothing
|
|
75
|
+
* @returns `true` when the report was created
|
|
10
76
|
*
|
|
11
77
|
* @category Post API
|
|
12
78
|
* @async
|
|
13
79
|
* */
|
|
14
|
-
export declare const flagPost:
|
|
80
|
+
export declare const flagPost: FlagPost;
|
|
81
|
+
export {};
|
|
15
82
|
//# sourceMappingURL=flagPost.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flagPost.d.ts","sourceRoot":"","sources":["../../../src/postRepository/api/flagPost.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flagPost.d.ts","sourceRoot":"","sources":["../../../src/postRepository/api/flagPost.ts"],"names":[],"mappings":"AAIA,aAAK,QAAQ,GAAG;IACd;;;;;;;;;;OAUG;IACH,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACrE;;;;;;;;;;;;;;;;;OAiBG;IACH,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACpF;;;;;;;;;;;;;;;OAeG;IACH,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACpF,CAAC;AAKF;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4BK;AACL,eAAO,MAAM,QAAQ,EAAE,QAMiB,CAAC"}
|
package/dist/postRepository/api/tests/integration/flagPost.overloads.integration.test.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flagPost.overloads.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/postRepository/api/tests/integration/flagPost.overloads.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* New `flagPost(postId, { reason, detail? })` implementation. Any category, including
|
|
3
|
+
* `Others`, may carry a `detail`. `detail` is forwarded unchanged (empty and
|
|
4
|
+
* whitespace-only strings included) and omitted from the request body when `undefined`;
|
|
5
|
+
* the backend enforces the 300-character limit.
|
|
6
|
+
*
|
|
7
|
+
* Not exported from the public API. It is reached through the
|
|
8
|
+
* `PostRepository.flagPost(postId, options)` overload; see `api/flagPost.ts`.
|
|
9
|
+
*
|
|
10
|
+
* @throws {ASCInvalidParameterError} `INVALID_PARAMETERS` when `options` is malformed, before any request is made
|
|
11
|
+
*/
|
|
12
|
+
export declare const flagPostWithOptions: (postId: Amity.Post['postId'], options: Amity.ContentFlagOptions) => Promise<boolean>;
|
|
13
|
+
//# sourceMappingURL=flagPostWithOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flagPostWithOptions.d.ts","sourceRoot":"","sources":["../../../src/postRepository/internalApi/flagPostWithOptions.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,WACtB,MAAM,IAAI,CAAC,QAAQ,CAAC,WACnB,MAAM,kBAAkB,KAChC,QAAQ,OAAO,CAoBjB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Legacy `flagPost(postId, reason?)` implementation, kept verbatim so existing
|
|
3
|
+
* callers keep the exact request body they had before the options contract existed:
|
|
4
|
+
*
|
|
5
|
+
* - predefined `ContentFlagReasonEnum` value → `{ reason: <value>, detail: '' }`
|
|
6
|
+
* - any other non-empty string (including the literal `'Others'`) → `{ reason: 'Others', detail: <string> }`
|
|
7
|
+
* - `undefined` or `''` → `{ reason: 'Others', detail: '' }`
|
|
8
|
+
*
|
|
9
|
+
* Not exported from the public API. It is reached through the deprecated
|
|
10
|
+
* `PostRepository.flagPost(postId, reason)` overload; see `api/flagPost.ts`.
|
|
11
|
+
*
|
|
12
|
+
* Not itself deprecated: it implements the deprecated legacy-string overload of the public
|
|
13
|
+
* `flagPost`, which carries the deprecation tag. New code should use `flagPostWithOptions`
|
|
14
|
+
* (the `{ reason, detail? }` contract). This path stays available throughout the current major version.
|
|
15
|
+
*/
|
|
16
|
+
export declare const flagPostWithReasonString: (postId: Amity.Post['postId'], reason?: Amity.ContentFlagReason) => Promise<boolean>;
|
|
17
|
+
//# sourceMappingURL=flagPostWithReasonString.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flagPostWithReasonString.d.ts","sourceRoot":"","sources":["../../../src/postRepository/internalApi/flagPostWithReasonString.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,wBAAwB,WAC3B,MAAM,IAAI,CAAC,QAAQ,CAAC,WACnB,MAAM,iBAAiB,KAC/B,QAAQ,OAAO,CA2BjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/postRepository/internalApi/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/postRepository/internalApi/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAE1B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flagPostWithOptions.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/postRepository/internalApi/tests/integration/flagPostWithOptions.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flagPostWithReasonString.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/postRepository/internalApi/tests/integration/flagPostWithReasonString.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isReportedByMe.d.ts","sourceRoot":"","sources":["../../../src/report/api/isReportedByMe.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"isReportedByMe.d.ts","sourceRoot":"","sources":["../../../src/report/api/isReportedByMe.ts"],"names":[],"mappings":"AAmEA;;;;;;;;;;;;KAYK;AACL,eAAO,MAAM,cAAc,kBACV,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,eACzC,MAAM,KAClB,QAAQ,OAAO,CAqBjB,CAAC"}
|
|
@@ -1,22 +1,63 @@
|
|
|
1
|
+
declare type FlagUser = {
|
|
2
|
+
/**
|
|
3
|
+
* ```js
|
|
4
|
+
* import { UserRepository } from '@amityco/ts-sdk'
|
|
5
|
+
* const flagged = await UserRepository.flagUser('userId')
|
|
6
|
+
* ```
|
|
7
|
+
*
|
|
8
|
+
* Flags a user with a typeless report. No request body is sent.
|
|
9
|
+
*
|
|
10
|
+
* To report a specific profile field use `flagUserProfile(userId, { field, comment })`;
|
|
11
|
+
* to report behavior use `flagUserBehavior(userId, { reason, comment })`.
|
|
12
|
+
*
|
|
13
|
+
* @param userId The ID of the user to be flagged
|
|
14
|
+
* @returns the flagged {@link Amity.User}
|
|
15
|
+
*/
|
|
16
|
+
(userId: Amity.User['userId'], options?: undefined): Promise<Amity.User>;
|
|
17
|
+
/**
|
|
18
|
+
* ```js
|
|
19
|
+
* import { UserRepository } from '@amityco/ts-sdk'
|
|
20
|
+
* const flaggedBehavior = await UserRepository.flagUser('userId', {
|
|
21
|
+
* reportType: 'behavior',
|
|
22
|
+
* reason: 'Harassment or bullying',
|
|
23
|
+
* comment: 'optional free-text',
|
|
24
|
+
* })
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @deprecated Use `flagUserProfile(userId, { field, comment })` to report a profile
|
|
28
|
+
* field, or `flagUserBehavior(userId, { reason, comment })` to report behavior. For a
|
|
29
|
+
* custom `Others` reason, pass `reason: ContentFlagReasonEnum.Others` and put the text
|
|
30
|
+
* in `comment`. `flagUser(userId)` without options stays supported. This overload's
|
|
31
|
+
* request mapping is unchanged and stays available throughout the current major version.
|
|
32
|
+
*
|
|
33
|
+
* @param userId The ID of the user to be flagged
|
|
34
|
+
* @param options Optional report metadata forwarded to the server as the request
|
|
35
|
+
* body: `reportType`, `reason`, `comment`. Only non-undefined fields are included.
|
|
36
|
+
* All validation is server-side; a bodyless call produces a typeless report.
|
|
37
|
+
* @returns the flagged {@link Amity.User}
|
|
38
|
+
*/
|
|
39
|
+
(userId: Amity.User['userId'], options?: Amity.UserReportOptions): Promise<Amity.User>;
|
|
40
|
+
};
|
|
1
41
|
/**
|
|
2
42
|
* ```js
|
|
3
43
|
* import { UserRepository } from '@amityco/ts-sdk'
|
|
44
|
+
*
|
|
45
|
+
* // Typeless report (supported).
|
|
4
46
|
* const flagged = await UserRepository.flagUser('userId')
|
|
5
|
-
* const flaggedBehavior = await UserRepository.flagUser('userId', {
|
|
6
|
-
* reportType: 'behavior',
|
|
7
|
-
* reason: 'Harassment or bullying',
|
|
8
|
-
* comment: 'optional free-text',
|
|
9
|
-
* })
|
|
10
47
|
* ```
|
|
11
48
|
*
|
|
49
|
+
* Flags a user. Two call shapes are accepted (see the overloads): id-only, which
|
|
50
|
+
* sends no body and stays supported, and the deprecated structured options object,
|
|
51
|
+
* whose request mapping is unchanged. New code reporting a profile field or behavior
|
|
52
|
+
* should use `flagUserProfile` or `flagUserBehavior`.
|
|
53
|
+
*
|
|
12
54
|
* @param userId The ID of the user to be flagged
|
|
13
|
-
* @param options
|
|
14
|
-
* body: `reportType`, `reason`, `comment`. Only non-null fields are included.
|
|
15
|
-
* All validation is server-side; a bodyless call produces a typeless report.
|
|
55
|
+
* @param options Deprecated report metadata; omit for a typeless report
|
|
16
56
|
* @returns the flagged {@link Amity.User}
|
|
17
57
|
*
|
|
18
58
|
* @category User API
|
|
19
59
|
* @async
|
|
20
60
|
* */
|
|
21
|
-
export declare const flagUser:
|
|
61
|
+
export declare const flagUser: FlagUser;
|
|
62
|
+
export {};
|
|
22
63
|
//# sourceMappingURL=flagUser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flagUser.d.ts","sourceRoot":"","sources":["../../../src/userRepository/api/flagUser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flagUser.d.ts","sourceRoot":"","sources":["../../../src/userRepository/api/flagUser.ts"],"names":[],"mappings":"AAiBA,aAAK,QAAQ,GAAG;IACd;;;;;;;;;;;;;OAaG;IACH,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACzE;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;CACxF,CAAC;AAKF;;;;;;;;;;;;;;;;;;;KAmBK;AACL,eAAO,MAAM,QAAQ,EAAE,QAuBtB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ```js
|
|
3
|
+
* import { UserRepository, ContentFlagReasonEnum } from '@amityco/ts-sdk'
|
|
4
|
+
* const flagged = await UserRepository.flagUserBehavior('userId', {
|
|
5
|
+
* reason: ContentFlagReasonEnum.Others,
|
|
6
|
+
* comment: 'Impersonating our brand',
|
|
7
|
+
* })
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* Reports a user's behavior. `reason` is required and is one of the nine
|
|
11
|
+
* `ContentFlagReasonEnum` values, sent as its canonical label. Reporter text, including
|
|
12
|
+
* the explanation for `Others`, always travels in `comment`; the reason never carries text.
|
|
13
|
+
*
|
|
14
|
+
* `comment` is trimmed; a blank comment is omitted from the request; a comment longer
|
|
15
|
+
* than 300 characters after trimming is rejected before any request. Otherwise the
|
|
16
|
+
* trimmed text is sent unchanged.
|
|
17
|
+
*
|
|
18
|
+
* Sends `POST /api/v4/me/flags/:userId` with `{ reportType: 'behavior', reason, comment? }`.
|
|
19
|
+
*
|
|
20
|
+
* @param userId The ID of the user to be reported
|
|
21
|
+
* @param options `reason` is a `ContentFlagReasonEnum` value; `comment` is optional free text
|
|
22
|
+
* @returns the flagged {@link Amity.User}
|
|
23
|
+
* @throws {ASCInvalidParameterError} `INVALID_PARAMETERS` when `options` is missing or malformed, `reason` is missing or unknown, or `comment` is over 300 characters, before any request is made
|
|
24
|
+
*
|
|
25
|
+
* @category User API
|
|
26
|
+
* @async
|
|
27
|
+
* */
|
|
28
|
+
export declare const flagUserBehavior: (userId: Amity.User['userId'], options: Amity.UserBehaviorReportOptions) => Promise<Amity.User>;
|
|
29
|
+
//# sourceMappingURL=flagUserBehavior.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flagUserBehavior.d.ts","sourceRoot":"","sources":["../../../src/userRepository/api/flagUserBehavior.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;KA0BK;AACL,eAAO,MAAM,gBAAgB,WACnB,MAAM,IAAI,CAAC,QAAQ,CAAC,WACnB,MAAM,yBAAyB,KACvC,QAAQ,MAAM,IAAI,CAC4D,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ```js
|
|
3
|
+
* import { UserRepository, UserProfileFieldEnum } from '@amityco/ts-sdk'
|
|
4
|
+
* const flagged = await UserRepository.flagUserProfile('userId', {
|
|
5
|
+
* field: UserProfileFieldEnum.AVATAR,
|
|
6
|
+
* comment: 'Nudity in profile photo',
|
|
7
|
+
* })
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* Reports one of a user's profile fields (display name, description or avatar). The
|
|
11
|
+
* call has no reason: profile reports never carry one, so the backend's reason rules
|
|
12
|
+
* cannot be violated from here. A `reason` key passed at runtime is ignored and never sent.
|
|
13
|
+
*
|
|
14
|
+
* `comment` is trimmed; a blank comment is omitted from the request; a comment longer
|
|
15
|
+
* than 300 characters after trimming is rejected before any request. Otherwise the
|
|
16
|
+
* trimmed text is sent unchanged.
|
|
17
|
+
*
|
|
18
|
+
* Sends `POST /api/v4/me/flags/:userId` with `{ reportType: <field>, comment? }`.
|
|
19
|
+
*
|
|
20
|
+
* @param userId The ID of the user to be reported
|
|
21
|
+
* @param options `field` is a `UserProfileFieldEnum` value; `comment` is optional free text
|
|
22
|
+
* @returns the flagged {@link Amity.User}
|
|
23
|
+
* @throws {ASCInvalidParameterError} `INVALID_PARAMETERS` when `options` is missing or malformed, or `comment` is over 300 characters, before any request is made
|
|
24
|
+
*
|
|
25
|
+
* @category User API
|
|
26
|
+
* @async
|
|
27
|
+
* */
|
|
28
|
+
export declare const flagUserProfile: (userId: Amity.User['userId'], options: Amity.UserProfileReportOptions) => Promise<Amity.User>;
|
|
29
|
+
//# sourceMappingURL=flagUserProfile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flagUserProfile.d.ts","sourceRoot":"","sources":["../../../src/userRepository/api/flagUserProfile.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;KA0BK;AACL,eAAO,MAAM,eAAe,WAClB,MAAM,IAAI,CAAC,QAAQ,CAAC,WACnB,MAAM,wBAAwB,KACtC,QAAQ,MAAM,IAAI,CAC0D,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { getUserByIds } from './getUserByIds';
|
|
2
2
|
export { updateUser } from './updateUser';
|
|
3
3
|
export { flagUser } from './flagUser';
|
|
4
|
+
export { flagUserProfile } from './flagUserProfile';
|
|
5
|
+
export { flagUserBehavior } from './flagUserBehavior';
|
|
4
6
|
export { unflagUser } from './unflagUser';
|
|
5
7
|
export { isUserFlaggedByMe } from './isUserFlaggedByMe';
|
|
6
8
|
export { getAllBlockedUsers } from './getAllBlockedUsers';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/userRepository/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/userRepository/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,14 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ```js
|
|
3
3
|
* import { UserRepository } from '@amityco/ts-sdk'
|
|
4
|
-
*
|
|
4
|
+
*
|
|
5
|
+
* const { isFlagByMe, flags } = await UserRepository.isUserFlaggedByMe('userId')
|
|
6
|
+
*
|
|
7
|
+
* // Grey out the report options already used; null marks the typeless report.
|
|
8
|
+
* const used = new Set(flags.map(flag => flag.reportType))
|
|
5
9
|
* ```
|
|
6
10
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
11
|
+
* Returns whether the caller has reported a user, with each of the caller's own reports
|
|
12
|
+
* on that user, exactly as `GET /api/v4/users/:userId/isFlagByMe` answers. Each report
|
|
13
|
+
* carries `reportType`, `reason`, `comment` and `createdAt`; a field the report does not
|
|
14
|
+
* have is `null`. `reportType: null` is the typeless (legacy) report, which `unflagUser`
|
|
15
|
+
* withdraws with `UserReportTypeFilterEnum.UNTYPED`. Only the caller's reports come back.
|
|
16
|
+
*
|
|
17
|
+
* This is the only source of per-type state. Nothing is filtered, cached or persisted:
|
|
18
|
+
* the call reads the server every time and does not consult `hashFlag`, which is a
|
|
19
|
+
* type-blind bloom filter. Call it again after a flag or unflag when the UI needs the
|
|
20
|
+
* updated per-type state.
|
|
21
|
+
*
|
|
22
|
+
* Breaking change: earlier versions returned a boolean from the v3 endpoint, which the
|
|
23
|
+
* backend has deprecated. Read `isFlagByMe` on the result for the same answer.
|
|
24
|
+
*
|
|
25
|
+
* @param userId The ID of the user to check
|
|
26
|
+
* @returns the caller's {@link Amity.UserFlagByMe} on that user
|
|
9
27
|
*
|
|
10
28
|
* @category Report API
|
|
11
29
|
* @async
|
|
12
30
|
* */
|
|
13
|
-
export declare const isUserFlaggedByMe: (userId: Amity.User['userId']) => Promise<
|
|
31
|
+
export declare const isUserFlaggedByMe: (userId: Amity.User['userId']) => Promise<Amity.UserFlagByMe>;
|
|
14
32
|
//# sourceMappingURL=isUserFlaggedByMe.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isUserFlaggedByMe.d.ts","sourceRoot":"","sources":["../../../src/userRepository/api/isUserFlaggedByMe.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"isUserFlaggedByMe.d.ts","sourceRoot":"","sources":["../../../src/userRepository/api/isUserFlaggedByMe.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6BK;AACL,eAAO,MAAM,iBAAiB,WACpB,MAAM,IAAI,CAAC,QAAQ,CAAC,KAC3B,QAAQ,MAAM,YAAY,CAS5B,CAAC"}
|
package/dist/userRepository/api/tests/integration/flagUser.overloads.integration.test.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flagUser.overloads.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/userRepository/api/tests/integration/flagUser.overloads.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flagUserBehavior.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/userRepository/api/tests/integration/flagUserBehavior.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flagUserProfile.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/userRepository/api/tests/integration/flagUserProfile.integration.test.ts"],"names":[],"mappings":""}
|