@amityco/ts-sdk 7.29.0 → 7.29.1-0bbc9cd8.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.
Files changed (148) hide show
  1. package/dist/@types/core/errors.d.ts +4 -1
  2. package/dist/@types/core/errors.d.ts.map +1 -1
  3. package/dist/@types/domains/channel.d.ts +13 -1
  4. package/dist/@types/domains/channel.d.ts.map +1 -1
  5. package/dist/@types/domains/content.d.ts +11 -0
  6. package/dist/@types/domains/content.d.ts.map +1 -1
  7. package/dist/@types/domains/event.d.ts +1 -1
  8. package/dist/@types/domains/event.d.ts.map +1 -1
  9. package/dist/@types/domains/group.d.ts +2 -2
  10. package/dist/@types/domains/group.d.ts.map +1 -1
  11. package/dist/@types/domains/user.d.ts +95 -0
  12. package/dist/@types/domains/user.d.ts.map +1 -1
  13. package/dist/channelRepository/events/onUserDeleted.d.ts.map +1 -1
  14. package/dist/channelRepository/observers/getChannels/ChannelLiveCollectionController.d.ts.map +1 -1
  15. package/dist/channelRepository/observers/searchChannels/SearchChannelLiveCollectionController.d.ts.map +1 -1
  16. package/dist/channelRepository/observers/tests/integrations/getChannelsSortByLastMessage.integration.test.d.ts +2 -0
  17. package/dist/channelRepository/observers/tests/integrations/getChannelsSortByLastMessage.integration.test.d.ts.map +1 -0
  18. package/dist/channelRepository/utils/channelActivityOnLoginHandler.d.ts +16 -0
  19. package/dist/channelRepository/utils/channelActivityOnLoginHandler.d.ts.map +1 -0
  20. package/dist/channelRepository/utils/tests/integrations/channelActivity.integration.test.d.ts +2 -0
  21. package/dist/channelRepository/utils/tests/integrations/channelActivity.integration.test.d.ts.map +1 -0
  22. package/dist/channelRepository/utils/tests/updateChannelActivityTimestamps.test.d.ts +2 -0
  23. package/dist/channelRepository/utils/tests/updateChannelActivityTimestamps.test.d.ts.map +1 -0
  24. package/dist/channelRepository/utils/updateChannelActivityTimestamps.d.ts +42 -0
  25. package/dist/channelRepository/utils/updateChannelActivityTimestamps.d.ts.map +1 -0
  26. package/dist/client/api/resumeSession.d.ts.map +1 -1
  27. package/dist/client/api/setupLoginSubscriptions.d.ts.map +1 -1
  28. package/dist/commentRepository/api/flagComment.d.ts +72 -5
  29. package/dist/commentRepository/api/flagComment.d.ts.map +1 -1
  30. package/dist/commentRepository/internalApi/flagCommentWithOptions.d.ts +13 -0
  31. package/dist/commentRepository/internalApi/flagCommentWithOptions.d.ts.map +1 -0
  32. package/dist/commentRepository/internalApi/flagCommentWithReasonString.d.ts +17 -0
  33. package/dist/commentRepository/internalApi/flagCommentWithReasonString.d.ts.map +1 -0
  34. package/dist/commentRepository/internalApi/index.d.ts +2 -0
  35. package/dist/commentRepository/internalApi/index.d.ts.map +1 -1
  36. package/dist/commentRepository/internalApi/tests/integration/flagCommentWithOptions.integration.test.d.ts +2 -0
  37. package/dist/commentRepository/internalApi/tests/integration/flagCommentWithOptions.integration.test.d.ts.map +1 -0
  38. package/dist/commentRepository/internalApi/tests/integration/flagCommentWithReasonString.integration.test.d.ts +2 -0
  39. package/dist/commentRepository/internalApi/tests/integration/flagCommentWithReasonString.integration.test.d.ts.map +1 -0
  40. package/dist/communityRepository/communityMembership/events/onUserDeleted.d.ts.map +1 -1
  41. package/dist/communityRepository/utils/payload.d.ts.map +1 -1
  42. package/dist/core/microtasks.d.ts.map +1 -1
  43. package/dist/core/query/sorting.d.ts +10 -0
  44. package/dist/core/query/sorting.d.ts.map +1 -1
  45. package/dist/core/query/tests/sorting.test.d.ts +2 -0
  46. package/dist/core/query/tests/sorting.test.d.ts.map +1 -0
  47. package/dist/core/tests/microtasks.test.d.ts +2 -0
  48. package/dist/core/tests/microtasks.test.d.ts.map +1 -0
  49. package/dist/core/transports/tests/integration/serverErrorCodes.integration.test.d.ts +2 -0
  50. package/dist/core/transports/tests/integration/serverErrorCodes.integration.test.d.ts.map +1 -0
  51. package/dist/group/utils/withUser.d.ts +3 -3
  52. package/dist/group/utils/withUser.d.ts.map +1 -1
  53. package/dist/index.cjs.js +953 -148
  54. package/dist/index.esm.js +954 -150
  55. package/dist/index.umd.js +2 -2
  56. package/dist/messagePreview/utils/getChannelMessagePreviewWithUser.d.ts +1 -0
  57. package/dist/messagePreview/utils/getChannelMessagePreviewWithUser.d.ts.map +1 -1
  58. package/dist/messagePreview/utils/getSubChannelMessagePreviewWithUser.d.ts +1 -1
  59. package/dist/messagePreview/utils/getSubChannelMessagePreviewWithUser.d.ts.map +1 -1
  60. package/dist/messageRepository/api/createMessage.d.ts.map +1 -1
  61. package/dist/messageRepository/api/flagMessage.d.ts +73 -6
  62. package/dist/messageRepository/api/flagMessage.d.ts.map +1 -1
  63. package/dist/messageRepository/api/tests/integration/flagMessage.overloads.integration.test.d.ts +2 -0
  64. package/dist/messageRepository/api/tests/integration/flagMessage.overloads.integration.test.d.ts.map +1 -0
  65. package/dist/messageRepository/internalApi/flagMessageWithOptions.d.ts +13 -0
  66. package/dist/messageRepository/internalApi/flagMessageWithOptions.d.ts.map +1 -0
  67. package/dist/messageRepository/internalApi/flagMessageWithReasonString.d.ts +18 -0
  68. package/dist/messageRepository/internalApi/flagMessageWithReasonString.d.ts.map +1 -0
  69. package/dist/messageRepository/internalApi/tests/integration/flagMessageWithOptions.integration.test.d.ts +2 -0
  70. package/dist/messageRepository/internalApi/tests/integration/flagMessageWithOptions.integration.test.d.ts.map +1 -0
  71. package/dist/messageRepository/internalApi/tests/integration/flagMessageWithReasonString.integration.test.d.ts +2 -0
  72. package/dist/messageRepository/internalApi/tests/integration/flagMessageWithReasonString.integration.test.d.ts.map +1 -0
  73. package/dist/postRepository/api/flagPost.d.ts +73 -6
  74. package/dist/postRepository/api/flagPost.d.ts.map +1 -1
  75. package/dist/postRepository/api/tests/integration/flagPost.overloads.integration.test.d.ts +2 -0
  76. package/dist/postRepository/api/tests/integration/flagPost.overloads.integration.test.d.ts.map +1 -0
  77. package/dist/postRepository/api/tests/integration/setup.d.ts +3 -3
  78. package/dist/postRepository/internalApi/flagPostWithOptions.d.ts +13 -0
  79. package/dist/postRepository/internalApi/flagPostWithOptions.d.ts.map +1 -0
  80. package/dist/postRepository/internalApi/flagPostWithReasonString.d.ts +17 -0
  81. package/dist/postRepository/internalApi/flagPostWithReasonString.d.ts.map +1 -0
  82. package/dist/postRepository/internalApi/index.d.ts +2 -0
  83. package/dist/postRepository/internalApi/index.d.ts.map +1 -1
  84. package/dist/postRepository/internalApi/tests/integration/flagPostWithOptions.integration.test.d.ts +2 -0
  85. package/dist/postRepository/internalApi/tests/integration/flagPostWithOptions.integration.test.d.ts.map +1 -0
  86. package/dist/postRepository/internalApi/tests/integration/flagPostWithReasonString.integration.test.d.ts +2 -0
  87. package/dist/postRepository/internalApi/tests/integration/flagPostWithReasonString.integration.test.d.ts.map +1 -0
  88. package/dist/postRepository/utils/payload.d.ts.map +1 -1
  89. package/dist/report/api/isReportedByMe.d.ts.map +1 -1
  90. package/dist/userRepository/api/flagUser.d.ts +50 -9
  91. package/dist/userRepository/api/flagUser.d.ts.map +1 -1
  92. package/dist/userRepository/api/flagUserBehavior.d.ts +29 -0
  93. package/dist/userRepository/api/flagUserBehavior.d.ts.map +1 -0
  94. package/dist/userRepository/api/flagUserProfile.d.ts +29 -0
  95. package/dist/userRepository/api/flagUserProfile.d.ts.map +1 -0
  96. package/dist/userRepository/api/index.d.ts +2 -0
  97. package/dist/userRepository/api/index.d.ts.map +1 -1
  98. package/dist/userRepository/api/isUserFlaggedByMe.d.ts +26 -4
  99. package/dist/userRepository/api/isUserFlaggedByMe.d.ts.map +1 -1
  100. package/dist/userRepository/api/queryBlockedUsers.d.ts.map +1 -1
  101. package/dist/userRepository/api/tests/integration/flagUser.overloads.integration.test.d.ts +2 -0
  102. package/dist/userRepository/api/tests/integration/flagUser.overloads.integration.test.d.ts.map +1 -0
  103. package/dist/userRepository/api/tests/integration/flagUserBehavior.integration.test.d.ts +2 -0
  104. package/dist/userRepository/api/tests/integration/flagUserBehavior.integration.test.d.ts.map +1 -0
  105. package/dist/userRepository/api/tests/integration/flagUserProfile.integration.test.d.ts +2 -0
  106. package/dist/userRepository/api/tests/integration/flagUserProfile.integration.test.d.ts.map +1 -0
  107. package/dist/userRepository/api/unflagUser.d.ts +26 -4
  108. package/dist/userRepository/api/unflagUser.d.ts.map +1 -1
  109. package/dist/userRepository/api/updateUser.d.ts.map +1 -1
  110. package/dist/userRepository/internalApi/getFlagsByMe.d.ts +21 -0
  111. package/dist/userRepository/internalApi/getFlagsByMe.d.ts.map +1 -0
  112. package/dist/userRepository/observers/getBlockedUsers/BlockedUserLiveCollectionController.d.ts +2 -2
  113. package/dist/userRepository/observers/getBlockedUsers/BlockedUserLiveCollectionController.d.ts.map +1 -1
  114. package/dist/userRepository/observers/getBlockingUsers/LiveCollectionController.d.ts +1 -1
  115. package/dist/userRepository/observers/getBlockingUsers/LiveCollectionController.d.ts.map +1 -1
  116. package/dist/userRepository/observers/getUsers/UserLiveCollectionController.d.ts +2 -2
  117. package/dist/userRepository/observers/getUsers/UserLiveCollectionController.d.ts.map +1 -1
  118. package/dist/userRepository/observers/searchUserByDisplayName/SearchUserLiveCollectionController.d.ts +2 -2
  119. package/dist/userRepository/observers/searchUserByDisplayName/SearchUserLiveCollectionController.d.ts.map +1 -1
  120. package/dist/userRepository/observers/searchUserByDisplayName.d.ts +1 -1
  121. package/dist/userRepository/observers/searchUserByDisplayName.d.ts.map +1 -1
  122. package/dist/userRepository/observers/searchUsers.d.ts +1 -1
  123. package/dist/userRepository/observers/searchUsers.d.ts.map +1 -1
  124. package/dist/userRepository/utils/submitUserReport.d.ts +10 -0
  125. package/dist/userRepository/utils/submitUserReport.d.ts.map +1 -0
  126. package/dist/userRepository/utils/userReport.d.ts +50 -0
  127. package/dist/userRepository/utils/userReport.d.ts.map +1 -0
  128. package/dist/utils/bloomFilter.d.ts +9 -0
  129. package/dist/utils/bloomFilter.d.ts.map +1 -0
  130. package/dist/utils/contentFlag.d.ts +28 -0
  131. package/dist/utils/contentFlag.d.ts.map +1 -0
  132. package/dist/utils/linkedObject/tests/userLinkedObject.test.d.ts +2 -0
  133. package/dist/utils/linkedObject/tests/userLinkedObject.test.d.ts.map +1 -0
  134. package/dist/utils/linkedObject/userLinkedObject.d.ts.map +1 -1
  135. package/dist/utils/tests/bloomFilter.test.d.ts +2 -0
  136. package/dist/utils/tests/bloomFilter.test.d.ts.map +1 -0
  137. package/dist/utils/tests/client.d.ts +1 -1
  138. package/dist/utils/tests/client.d.ts.map +1 -1
  139. package/dist/utils/tests/dummy/channel.d.ts +31 -10
  140. package/dist/utils/tests/dummy/channel.d.ts.map +1 -1
  141. package/dist/utils/tests/dummy/comment.d.ts +1 -1
  142. package/dist/utils/tests/dummy/community.d.ts +2 -2
  143. package/dist/utils/tests/dummy/community.d.ts.map +1 -1
  144. package/dist/utils/tests/dummy/message.d.ts +1 -1
  145. package/dist/utils/tests/dummy/token.d.ts +1 -1
  146. package/dist/utils/tests/dummy/user.d.ts +10 -12
  147. package/dist/utils/tests/dummy/user.d.ts.map +1 -1
  148. 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAEpB,MAAM,cAAc,GAAG,IAAI;CAoB5C,CAAC"}
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,6 +1,6 @@
1
1
  export declare const getSubChannelMessagePreviewWithUser: (subChannel: Amity.SubChannel) => {
2
2
  messagePreview: {
3
- user: Amity.InternalUser | undefined;
3
+ user: Amity.User | undefined;
4
4
  messagePreviewId: string;
5
5
  subChannelName: string;
6
6
  data?: string | Record<string, unknown> | Amity.ContentDataText | Amity.ContentDataFile | Amity.ContentDataImage | Amity.ContentDataVideo | Amity.ContentDataAudio | Amity.ContentDataPoll | Amity.ContentDataStream | Amity.ContentDataClip | Amity.ContentDataRoom | Amity.ContentDataEvent | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"getSubChannelMessagePreviewWithUser.d.ts","sourceRoot":"","sources":["../../../src/messagePreview/utils/getSubChannelMessagePreviewWithUser.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mCAAmC,eAAgB,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAa/E,CAAC"}
1
+ {"version":3,"file":"getSubChannelMessagePreviewWithUser.d.ts","sourceRoot":"","sources":["../../../src/messagePreview/utils/getSubChannelMessagePreviewWithUser.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mCAAmC,eAAgB,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoB/E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createMessage.d.ts","sourceRoot":"","sources":["../../../src/messageRepository/api/createMessage.ts"],"names":[],"mappings":"AAmBA,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;AAqEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,aAAa,yEAEvB,QAAQ,MAAM,MAAM,CAAC,MAAM,OAAO,CAAC,CAuCrC,CAAC"}
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
- * const flagged = await MessageRepository.flagMessage(messageId, reason)
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
- * @param messageId of the message to flag
8
- * @param reason the reason to flag the message
9
- * @returns the created report result
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: (messageId: Amity.Message['messageId'], reason?: Amity.ContentFlagReason) => Promise<boolean>;
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":"AASA;;;;;;;;;;;;KAYK;AACL,eAAO,MAAM,WAAW,cACX,MAAM,OAAO,CAAC,WAAW,CAAC,WAC5B,MAAM,iBAAiB,KAC/B,QAAQ,OAAO,CA4BjB,CAAC"}
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"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=flagMessage.overloads.integration.test.d.ts.map
@@ -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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=flagMessageWithOptions.integration.test.d.ts.map
@@ -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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=flagMessageWithReasonString.integration.test.d.ts.map
@@ -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
- * const flagged = await PostRepository.flagPost(postId, reason)
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
- * @param postId of the post to flag
8
- * @param reason the reason to flag the post
9
- * @returns a boolean
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: (postId: Amity.Post['postId'], reason?: Amity.ContentFlagReason) => Promise<boolean>;
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":"AASA;;;;;;;;;;;;KAYK;AACL,eAAO,MAAM,QAAQ,WACX,MAAM,IAAI,CAAC,QAAQ,CAAC,WACnB,MAAM,iBAAiB,KAC/B,QAAQ,OAAO,CA2BjB,CAAC"}
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"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=flagPost.overloads.integration.test.d.ts.map
@@ -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":""}
@@ -15,7 +15,7 @@ export declare const roomPostWithProductTags: Amity.InternalPost<any>;
15
15
  export declare const roomPostWithPinnedProduct: Amity.InternalPost<any>;
16
16
  export declare const createPostPayload: {
17
17
  posts: Amity.Post<any>[];
18
- users: Amity.User[];
18
+ users: Amity.InternalUser[];
19
19
  postChildren: never[];
20
20
  communities: never[];
21
21
  communityUsers: never[];
@@ -30,7 +30,7 @@ export declare const createPostPayload: {
30
30
  };
31
31
  export declare const getPostPayload: {
32
32
  posts: Amity.Post<any>[];
33
- users: Amity.User[];
33
+ users: Amity.InternalUser[];
34
34
  postChildren: never[];
35
35
  communities: never[];
36
36
  communityUsers: never[];
@@ -45,7 +45,7 @@ export declare const getPostPayload: {
45
45
  };
46
46
  export declare const queryPostsPayload: {
47
47
  posts: Amity.Post<any>[];
48
- users: Amity.User[];
48
+ users: Amity.InternalUser[];
49
49
  paging: {
50
50
  next: undefined;
51
51
  };
@@ -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,2 +1,4 @@
1
1
  export * from './getPost';
2
+ export * from './flagPostWithReasonString';
3
+ export * from './flagPostWithOptions';
2
4
  //# sourceMappingURL=index.d.ts.map
@@ -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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=flagPostWithOptions.integration.test.d.ts.map
@@ -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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=flagPostWithReasonString.integration.test.d.ts.map
@@ -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":"payload.d.ts","sourceRoot":"","sources":["../../../src/postRepository/utils/payload.ts"],"names":[],"mappings":"AAyBA,eAAO,MAAM,kBAAkB,YAAa,MAAM,WAAW,KAAG,MAAM,oBAiFrE,CAAC;AAEF,eAAO,MAAM,gCAAgC,4CAI1C,MAAM,yBAAyB,KAAG,MAAM,kCAO1C,CAAC"}
1
+ {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../src/postRepository/utils/payload.ts"],"names":[],"mappings":"AA2BA,eAAO,MAAM,kBAAkB,YAAa,MAAM,WAAW,KAAG,MAAM,oBAiFrE,CAAC;AAEF,eAAO,MAAM,gCAAgC,4CAI1C,MAAM,yBAAyB,KAAG,MAAM,kCAO1C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"isReportedByMe.d.ts","sourceRoot":"","sources":["../../../src/report/api/isReportedByMe.ts"],"names":[],"mappings":"AAgEA;;;;;;;;;;;;KAYK;AACL,eAAO,MAAM,cAAc,kBACV,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,eACzC,MAAM,KAClB,QAAQ,OAAO,CAqBjB,CAAC"}
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 Optional report metadata forwarded to the server as the request
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: (userId: Amity.User['userId'], options?: Amity.UserReportOptions) => Promise<Amity.User>;
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":"AAoBA;;;;;;;;;;;;;;;;;;;KAmBK;AACL,eAAO,MAAM,QAAQ,WACX,MAAM,IAAI,CAAC,QAAQ,CAAC,YAClB,MAAM,iBAAiB,KAChC,QAAQ,MAAM,IAAI,CAoBpB,CAAC"}
1
+ {"version":3,"file":"flagUser.d.ts","sourceRoot":"","sources":["../../../src/userRepository/api/flagUser.ts"],"names":[],"mappings":"AAkBA,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,36 @@
1
1
  /**
2
2
  * ```js
3
3
  * import { UserRepository } from '@amityco/ts-sdk'
4
- * const isFlagged = await UserRepository.isUserFlaggedByMe(postId)
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
- * @param userId The ID of the thing to check a report to.
8
- * @returns `true` if the report is created by me, `false` if doesn't.
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
+ * @deprecated On an {@link Amity.User} you already hold, read `user.isFlaggedByMe` for a
26
+ * request-free badge and call `user.getUserFlagsByMe()` for the reports; it skips the request
27
+ * when the Bloom test says the user is not flagged. This function remains the underlying request.
28
+ *
29
+ * @param userId The ID of the user to check
30
+ * @returns the caller's {@link Amity.UserFlagByMe} on that user
9
31
  *
10
32
  * @category Report API
11
33
  * @async
12
34
  * */
13
- export declare const isUserFlaggedByMe: (userId: Amity.User['userId']) => Promise<boolean>;
35
+ export declare const isUserFlaggedByMe: (userId: Amity.User['userId']) => Promise<Amity.UserFlagByMe>;
14
36
  //# sourceMappingURL=isUserFlaggedByMe.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isUserFlaggedByMe.d.ts","sourceRoot":"","sources":["../../../src/userRepository/api/isUserFlaggedByMe.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;KAWK;AACL,eAAO,MAAM,iBAAiB,WAAkB,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAG,QAAQ,OAAO,CASrF,CAAC"}
1
+ {"version":3,"file":"isUserFlaggedByMe.d.ts","sourceRoot":"","sources":["../../../src/userRepository/api/isUserFlaggedByMe.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiCK;AACL,eAAO,MAAM,iBAAiB,WACpB,MAAM,IAAI,CAAC,QAAQ,CAAC,KAC3B,QAAQ,MAAM,YAAY,CAK5B,CAAC"}