@amityco/ts-sdk 7.27.2-1852fdfa.0 → 7.27.2-47e3d79d.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 (39) hide show
  1. package/dist/commentRepository/{api → internalApi}/flagCommentWithOptions.d.ts +1 -1
  2. package/dist/commentRepository/internalApi/flagCommentWithOptions.d.ts.map +1 -0
  3. package/dist/commentRepository/{api → internalApi}/flagCommentWithReasonString.d.ts +4 -3
  4. package/dist/commentRepository/internalApi/flagCommentWithReasonString.d.ts.map +1 -0
  5. package/dist/commentRepository/internalApi/index.d.ts +2 -0
  6. package/dist/commentRepository/internalApi/index.d.ts.map +1 -1
  7. package/dist/commentRepository/{api → internalApi}/tests/integration/flagCommentWithOptions.integration.test.d.ts.map +1 -1
  8. package/dist/commentRepository/{api → internalApi}/tests/integration/flagCommentWithReasonString.integration.test.d.ts.map +1 -1
  9. package/dist/index.cjs.js +24 -15
  10. package/dist/index.esm.js +24 -15
  11. package/dist/index.umd.js +1 -1
  12. package/dist/messageRepository/{api → internalApi}/flagMessageWithOptions.d.ts +1 -1
  13. package/dist/messageRepository/internalApi/flagMessageWithOptions.d.ts.map +1 -0
  14. package/dist/messageRepository/{api → internalApi}/flagMessageWithReasonString.d.ts +4 -3
  15. package/dist/messageRepository/internalApi/flagMessageWithReasonString.d.ts.map +1 -0
  16. package/dist/messageRepository/{api → internalApi}/tests/integration/flagMessageWithOptions.integration.test.d.ts.map +1 -1
  17. package/dist/messageRepository/{api → internalApi}/tests/integration/flagMessageWithReasonString.integration.test.d.ts.map +1 -1
  18. package/dist/postRepository/{api → internalApi}/flagPostWithOptions.d.ts +1 -1
  19. package/dist/postRepository/internalApi/flagPostWithOptions.d.ts.map +1 -0
  20. package/dist/postRepository/{api → internalApi}/flagPostWithReasonString.d.ts +4 -3
  21. package/dist/postRepository/internalApi/flagPostWithReasonString.d.ts.map +1 -0
  22. package/dist/postRepository/internalApi/index.d.ts +2 -0
  23. package/dist/postRepository/internalApi/index.d.ts.map +1 -1
  24. package/dist/postRepository/internalApi/tests/integration/flagPostWithOptions.integration.test.d.ts.map +1 -0
  25. package/dist/postRepository/{api → internalApi}/tests/integration/flagPostWithReasonString.integration.test.d.ts.map +1 -1
  26. package/package.json +1 -1
  27. package/dist/commentRepository/api/flagCommentWithOptions.d.ts.map +0 -1
  28. package/dist/commentRepository/api/flagCommentWithReasonString.d.ts.map +0 -1
  29. package/dist/messageRepository/api/flagMessageWithOptions.d.ts.map +0 -1
  30. package/dist/messageRepository/api/flagMessageWithReasonString.d.ts.map +0 -1
  31. package/dist/postRepository/api/flagPostWithOptions.d.ts.map +0 -1
  32. package/dist/postRepository/api/flagPostWithReasonString.d.ts.map +0 -1
  33. package/dist/postRepository/api/tests/integration/flagPostWithOptions.integration.test.d.ts.map +0 -1
  34. /package/dist/commentRepository/{api → internalApi}/tests/integration/flagCommentWithOptions.integration.test.d.ts +0 -0
  35. /package/dist/commentRepository/{api → internalApi}/tests/integration/flagCommentWithReasonString.integration.test.d.ts +0 -0
  36. /package/dist/messageRepository/{api → internalApi}/tests/integration/flagMessageWithOptions.integration.test.d.ts +0 -0
  37. /package/dist/messageRepository/{api → internalApi}/tests/integration/flagMessageWithReasonString.integration.test.d.ts +0 -0
  38. /package/dist/postRepository/{api → internalApi}/tests/integration/flagPostWithOptions.integration.test.d.ts +0 -0
  39. /package/dist/postRepository/{api → internalApi}/tests/integration/flagPostWithReasonString.integration.test.d.ts +0 -0
@@ -5,7 +5,7 @@
5
5
  * the backend enforces the 300-character limit.
6
6
  *
7
7
  * Not exported from the public API. It is reached through the
8
- * `CommentRepository.flagComment(commentId, options)` overload; see `flagComment.ts`.
8
+ * `CommentRepository.flagComment(commentId, options)` overload; see `api/flagComment.ts`.
9
9
  *
10
10
  * @throws {ASCInvalidParameterError} `INVALID_PARAMETERS` when `options` is malformed, before any request is made
11
11
  */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flagCommentWithOptions.d.ts","sourceRoot":"","sources":["../../../src/commentRepository/internalApi/flagCommentWithOptions.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,cACtB,aAAa,CAAC,WAAW,CAAC,WAC5B,MAAM,kBAAkB,KAChC,QAAQ,OAAO,CAoBjB,CAAC"}
@@ -7,10 +7,11 @@
7
7
  * - `undefined` or `''` → `{ reason: 'Others', detail: '' }`
8
8
  *
9
9
  * Not exported from the public API. It is reached through the deprecated
10
- * `CommentRepository.flagComment(commentId, reason)` overload; see `flagComment.ts`.
10
+ * `CommentRepository.flagComment(commentId, reason)` overload; see `api/flagComment.ts`.
11
11
  *
12
- * @deprecated Use `flagCommentWithOptions` (the `{ reason, detail? }` contract) for new code.
13
- * This path stays available throughout the current major version.
12
+ * Not itself deprecated: it implements the deprecated legacy-string overload of the public
13
+ * `flagComment`, which carries the deprecation tag. New code should use `flagCommentWithOptions`
14
+ * (the `{ reason, detail? }` contract). This path stays available throughout the current major version.
14
15
  */
15
16
  export declare const flagCommentWithReasonString: (commentId: Amity.Comment['commentId'], reason?: Amity.ContentFlagReason) => Promise<boolean>;
16
17
  //# sourceMappingURL=flagCommentWithReasonString.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flagCommentWithReasonString.d.ts","sourceRoot":"","sources":["../../../src/commentRepository/internalApi/flagCommentWithReasonString.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,2BAA2B,cAC3B,aAAa,CAAC,WAAW,CAAC,WAC5B,MAAM,iBAAiB,KAC/B,QAAQ,OAAO,CA2BjB,CAAC"}
@@ -7,4 +7,6 @@ export * from './hardDeleteComment';
7
7
  export * from './flagComment';
8
8
  export * from './unflagComment';
9
9
  export * from './isCommentFlaggedByMe';
10
+ export * from './flagCommentWithReasonString';
11
+ export * from './flagCommentWithOptions';
10
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commentRepository/internalApi/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAElC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AAEpC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commentRepository/internalApi/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAElC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AAEpC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AAEvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"flagCommentWithOptions.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/commentRepository/api/tests/integration/flagCommentWithOptions.integration.test.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"flagCommentWithOptions.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/commentRepository/internalApi/tests/integration/flagCommentWithOptions.integration.test.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"flagCommentWithReasonString.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/commentRepository/api/tests/integration/flagCommentWithReasonString.integration.test.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"flagCommentWithReasonString.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/commentRepository/internalApi/tests/integration/flagCommentWithReasonString.integration.test.ts"],"names":[],"mappings":""}
package/dist/index.cjs.js CHANGED
@@ -20379,14 +20379,16 @@ const toContentFlagBody = ({ reason, detail }) => detail === undefined ? { reaso
20379
20379
  * the backend enforces the 300-character limit.
20380
20380
  *
20381
20381
  * Not exported from the public API. It is reached through the
20382
- * `MessageRepository.flagMessage(messageId, options)` overload; see `flagMessage.ts`.
20382
+ * `MessageRepository.flagMessage(messageId, options)` overload; see `api/flagMessage.ts`.
20383
20383
  *
20384
20384
  * @throws {ASCInvalidParameterError} `INVALID_PARAMETERS` when `options` is malformed, before any request is made
20385
20385
  */
20386
20386
  const flagMessageWithOptions = async (messageId, options) => {
20387
+ // Validate first: an input error must surface as INVALID_PARAMETERS regardless of
20388
+ // whether a client is active, and validation needs nothing from the client.
20389
+ const body = toContentFlagBody(validateContentFlagOptions('flagMessage', options));
20387
20390
  const client = getActiveClient();
20388
20391
  client.log('message/flag', messageId);
20389
- const body = toContentFlagBody(validateContentFlagOptions('flagMessage', options));
20390
20392
  const { data: payload } = await client.http.post(`/api/v5/messages/${encodeURIComponent(messageId)}/flags`, body);
20391
20393
  if (client.cache) {
20392
20394
  const messagePayload = await prepareMessagePayload(payload);
@@ -20406,10 +20408,11 @@ const flagMessageWithOptions = async (messageId, options) => {
20406
20408
  * (for `undefined` the message body carries `detail: undefined`, which JSON serialization omits)
20407
20409
  *
20408
20410
  * Not exported from the public API. It is reached through the deprecated
20409
- * `MessageRepository.flagMessage(messageId, reason)` overload; see `flagMessage.ts`.
20411
+ * `MessageRepository.flagMessage(messageId, reason)` overload; see `api/flagMessage.ts`.
20410
20412
  *
20411
- * @deprecated Use `flagMessageWithOptions` (the `{ reason, detail? }` contract) for new code.
20412
- * This path stays available throughout the current major version.
20413
+ * Not itself deprecated: it implements the deprecated legacy-string overload of the public
20414
+ * `flagMessage`, which carries the deprecation tag. New code should use `flagMessageWithOptions`
20415
+ * (the `{ reason, detail? }` contract). This path stays available throughout the current major version.
20413
20416
  */
20414
20417
  const flagMessageWithReasonString = async (messageId, reason) => {
20415
20418
  const client = getActiveClient();
@@ -27618,10 +27621,11 @@ const declineComment = async (commentId, reason) => {
27618
27621
  * - `undefined` or `''` → `{ reason: 'Others', detail: '' }`
27619
27622
  *
27620
27623
  * Not exported from the public API. It is reached through the deprecated
27621
- * `CommentRepository.flagComment(commentId, reason)` overload; see `flagComment.ts`.
27624
+ * `CommentRepository.flagComment(commentId, reason)` overload; see `api/flagComment.ts`.
27622
27625
  *
27623
- * @deprecated Use `flagCommentWithOptions` (the `{ reason, detail? }` contract) for new code.
27624
- * This path stays available throughout the current major version.
27626
+ * Not itself deprecated: it implements the deprecated legacy-string overload of the public
27627
+ * `flagComment`, which carries the deprecation tag. New code should use `flagCommentWithOptions`
27628
+ * (the `{ reason, detail? }` contract). This path stays available throughout the current major version.
27625
27629
  */
27626
27630
  const flagCommentWithReasonString = async (commentId, reason) => {
27627
27631
  const client = getActiveClient();
@@ -27647,14 +27651,16 @@ const flagCommentWithReasonString = async (commentId, reason) => {
27647
27651
  * the backend enforces the 300-character limit.
27648
27652
  *
27649
27653
  * Not exported from the public API. It is reached through the
27650
- * `CommentRepository.flagComment(commentId, options)` overload; see `flagComment.ts`.
27654
+ * `CommentRepository.flagComment(commentId, options)` overload; see `api/flagComment.ts`.
27651
27655
  *
27652
27656
  * @throws {ASCInvalidParameterError} `INVALID_PARAMETERS` when `options` is malformed, before any request is made
27653
27657
  */
27654
27658
  const flagCommentWithOptions = async (commentId, options) => {
27659
+ // Validate first: an input error must surface as INVALID_PARAMETERS regardless of
27660
+ // whether a client is active, and validation needs nothing from the client.
27661
+ const body = toContentFlagBody(validateContentFlagOptions('flagComment', options));
27655
27662
  const client = getActiveClient();
27656
27663
  client.log('comment/flagComment', commentId);
27657
- const body = toContentFlagBody(validateContentFlagOptions('flagComment', options));
27658
27664
  const { data: payload } = await client.http.post(`/api/v3/comments/${encodeURIComponent(commentId)}/flag`, body);
27659
27665
  if (client.cache) {
27660
27666
  ingestInCache(payload);
@@ -30058,14 +30064,16 @@ const declinePost = async (postId) => {
30058
30064
  * the backend enforces the 300-character limit.
30059
30065
  *
30060
30066
  * Not exported from the public API. It is reached through the
30061
- * `PostRepository.flagPost(postId, options)` overload; see `flagPost.ts`.
30067
+ * `PostRepository.flagPost(postId, options)` overload; see `api/flagPost.ts`.
30062
30068
  *
30063
30069
  * @throws {ASCInvalidParameterError} `INVALID_PARAMETERS` when `options` is malformed, before any request is made
30064
30070
  */
30065
30071
  const flagPostWithOptions = async (postId, options) => {
30072
+ // Validate first: an input error must surface as INVALID_PARAMETERS regardless of
30073
+ // whether a client is active, and validation needs nothing from the client.
30074
+ const body = toContentFlagBody(validateContentFlagOptions('flagPost', options));
30066
30075
  const client = getActiveClient();
30067
30076
  client.log('post/flagPost', postId);
30068
- const body = toContentFlagBody(validateContentFlagOptions('flagPost', options));
30069
30077
  const { data: payload } = await client.http.post(`/api/v3/posts/${encodeURIComponent(postId)}/flag`, body);
30070
30078
  if (client.cache) {
30071
30079
  ingestInCache(prepareMembershipPayload(payload, 'communityUsers'));
@@ -30083,10 +30091,11 @@ const flagPostWithOptions = async (postId, options) => {
30083
30091
  * - `undefined` or `''` → `{ reason: 'Others', detail: '' }`
30084
30092
  *
30085
30093
  * Not exported from the public API. It is reached through the deprecated
30086
- * `PostRepository.flagPost(postId, reason)` overload; see `flagPost.ts`.
30094
+ * `PostRepository.flagPost(postId, reason)` overload; see `api/flagPost.ts`.
30087
30095
  *
30088
- * @deprecated Use `flagPostWithOptions` (the `{ reason, detail? }` contract) for new code.
30089
- * This path stays available throughout the current major version.
30096
+ * Not itself deprecated: it implements the deprecated legacy-string overload of the public
30097
+ * `flagPost`, which carries the deprecation tag. New code should use `flagPostWithOptions`
30098
+ * (the `{ reason, detail? }` contract). This path stays available throughout the current major version.
30090
30099
  */
30091
30100
  const flagPostWithReasonString = async (postId, reason) => {
30092
30101
  const client = getActiveClient();
package/dist/index.esm.js CHANGED
@@ -20379,14 +20379,16 @@ const toContentFlagBody = ({ reason, detail }) => detail === undefined ? { reaso
20379
20379
  * the backend enforces the 300-character limit.
20380
20380
  *
20381
20381
  * Not exported from the public API. It is reached through the
20382
- * `MessageRepository.flagMessage(messageId, options)` overload; see `flagMessage.ts`.
20382
+ * `MessageRepository.flagMessage(messageId, options)` overload; see `api/flagMessage.ts`.
20383
20383
  *
20384
20384
  * @throws {ASCInvalidParameterError} `INVALID_PARAMETERS` when `options` is malformed, before any request is made
20385
20385
  */
20386
20386
  const flagMessageWithOptions = async (messageId, options) => {
20387
+ // Validate first: an input error must surface as INVALID_PARAMETERS regardless of
20388
+ // whether a client is active, and validation needs nothing from the client.
20389
+ const body = toContentFlagBody(validateContentFlagOptions('flagMessage', options));
20387
20390
  const client = getActiveClient();
20388
20391
  client.log('message/flag', messageId);
20389
- const body = toContentFlagBody(validateContentFlagOptions('flagMessage', options));
20390
20392
  const { data: payload } = await client.http.post(`/api/v5/messages/${encodeURIComponent(messageId)}/flags`, body);
20391
20393
  if (client.cache) {
20392
20394
  const messagePayload = await prepareMessagePayload(payload);
@@ -20406,10 +20408,11 @@ const flagMessageWithOptions = async (messageId, options) => {
20406
20408
  * (for `undefined` the message body carries `detail: undefined`, which JSON serialization omits)
20407
20409
  *
20408
20410
  * Not exported from the public API. It is reached through the deprecated
20409
- * `MessageRepository.flagMessage(messageId, reason)` overload; see `flagMessage.ts`.
20411
+ * `MessageRepository.flagMessage(messageId, reason)` overload; see `api/flagMessage.ts`.
20410
20412
  *
20411
- * @deprecated Use `flagMessageWithOptions` (the `{ reason, detail? }` contract) for new code.
20412
- * This path stays available throughout the current major version.
20413
+ * Not itself deprecated: it implements the deprecated legacy-string overload of the public
20414
+ * `flagMessage`, which carries the deprecation tag. New code should use `flagMessageWithOptions`
20415
+ * (the `{ reason, detail? }` contract). This path stays available throughout the current major version.
20413
20416
  */
20414
20417
  const flagMessageWithReasonString = async (messageId, reason) => {
20415
20418
  const client = getActiveClient();
@@ -27618,10 +27621,11 @@ const declineComment = async (commentId, reason) => {
27618
27621
  * - `undefined` or `''` → `{ reason: 'Others', detail: '' }`
27619
27622
  *
27620
27623
  * Not exported from the public API. It is reached through the deprecated
27621
- * `CommentRepository.flagComment(commentId, reason)` overload; see `flagComment.ts`.
27624
+ * `CommentRepository.flagComment(commentId, reason)` overload; see `api/flagComment.ts`.
27622
27625
  *
27623
- * @deprecated Use `flagCommentWithOptions` (the `{ reason, detail? }` contract) for new code.
27624
- * This path stays available throughout the current major version.
27626
+ * Not itself deprecated: it implements the deprecated legacy-string overload of the public
27627
+ * `flagComment`, which carries the deprecation tag. New code should use `flagCommentWithOptions`
27628
+ * (the `{ reason, detail? }` contract). This path stays available throughout the current major version.
27625
27629
  */
27626
27630
  const flagCommentWithReasonString = async (commentId, reason) => {
27627
27631
  const client = getActiveClient();
@@ -27647,14 +27651,16 @@ const flagCommentWithReasonString = async (commentId, reason) => {
27647
27651
  * the backend enforces the 300-character limit.
27648
27652
  *
27649
27653
  * Not exported from the public API. It is reached through the
27650
- * `CommentRepository.flagComment(commentId, options)` overload; see `flagComment.ts`.
27654
+ * `CommentRepository.flagComment(commentId, options)` overload; see `api/flagComment.ts`.
27651
27655
  *
27652
27656
  * @throws {ASCInvalidParameterError} `INVALID_PARAMETERS` when `options` is malformed, before any request is made
27653
27657
  */
27654
27658
  const flagCommentWithOptions = async (commentId, options) => {
27659
+ // Validate first: an input error must surface as INVALID_PARAMETERS regardless of
27660
+ // whether a client is active, and validation needs nothing from the client.
27661
+ const body = toContentFlagBody(validateContentFlagOptions('flagComment', options));
27655
27662
  const client = getActiveClient();
27656
27663
  client.log('comment/flagComment', commentId);
27657
- const body = toContentFlagBody(validateContentFlagOptions('flagComment', options));
27658
27664
  const { data: payload } = await client.http.post(`/api/v3/comments/${encodeURIComponent(commentId)}/flag`, body);
27659
27665
  if (client.cache) {
27660
27666
  ingestInCache(payload);
@@ -30058,14 +30064,16 @@ const declinePost = async (postId) => {
30058
30064
  * the backend enforces the 300-character limit.
30059
30065
  *
30060
30066
  * Not exported from the public API. It is reached through the
30061
- * `PostRepository.flagPost(postId, options)` overload; see `flagPost.ts`.
30067
+ * `PostRepository.flagPost(postId, options)` overload; see `api/flagPost.ts`.
30062
30068
  *
30063
30069
  * @throws {ASCInvalidParameterError} `INVALID_PARAMETERS` when `options` is malformed, before any request is made
30064
30070
  */
30065
30071
  const flagPostWithOptions = async (postId, options) => {
30072
+ // Validate first: an input error must surface as INVALID_PARAMETERS regardless of
30073
+ // whether a client is active, and validation needs nothing from the client.
30074
+ const body = toContentFlagBody(validateContentFlagOptions('flagPost', options));
30066
30075
  const client = getActiveClient();
30067
30076
  client.log('post/flagPost', postId);
30068
- const body = toContentFlagBody(validateContentFlagOptions('flagPost', options));
30069
30077
  const { data: payload } = await client.http.post(`/api/v3/posts/${encodeURIComponent(postId)}/flag`, body);
30070
30078
  if (client.cache) {
30071
30079
  ingestInCache(prepareMembershipPayload(payload, 'communityUsers'));
@@ -30083,10 +30091,11 @@ const flagPostWithOptions = async (postId, options) => {
30083
30091
  * - `undefined` or `''` → `{ reason: 'Others', detail: '' }`
30084
30092
  *
30085
30093
  * Not exported from the public API. It is reached through the deprecated
30086
- * `PostRepository.flagPost(postId, reason)` overload; see `flagPost.ts`.
30094
+ * `PostRepository.flagPost(postId, reason)` overload; see `api/flagPost.ts`.
30087
30095
  *
30088
- * @deprecated Use `flagPostWithOptions` (the `{ reason, detail? }` contract) for new code.
30089
- * This path stays available throughout the current major version.
30096
+ * Not itself deprecated: it implements the deprecated legacy-string overload of the public
30097
+ * `flagPost`, which carries the deprecation tag. New code should use `flagPostWithOptions`
30098
+ * (the `{ reason, detail? }` contract). This path stays available throughout the current major version.
30090
30099
  */
30091
30100
  const flagPostWithReasonString = async (postId, reason) => {
30092
30101
  const client = getActiveClient();