@amityco/ts-sdk 7.28.1-ff89ba3b.0 → 7.29.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 +0 -2
- package/dist/@types/core/errors.d.ts.map +1 -1
- package/dist/@types/domains/channel.d.ts +1 -13
- package/dist/@types/domains/channel.d.ts.map +1 -1
- package/dist/@types/domains/content.d.ts +0 -11
- package/dist/@types/domains/content.d.ts.map +1 -1
- package/dist/@types/domains/user.d.ts +0 -31
- 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/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 +5 -72
- package/dist/commentRepository/api/flagComment.d.ts.map +1 -1
- package/dist/commentRepository/internalApi/index.d.ts +0 -2
- package/dist/commentRepository/internalApi/index.d.ts.map +1 -1
- package/dist/core/microtasks.d.ts.map +1 -1
- package/dist/core/query/sorting.d.ts +0 -19
- package/dist/core/query/sorting.d.ts.map +1 -1
- package/dist/index.cjs.js +77 -649
- package/dist/index.esm.js +78 -648
- package/dist/index.umd.js +2 -2
- package/dist/messagePreview/utils/getChannelMessagePreviewWithUser.d.ts +0 -1
- 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 +6 -73
- package/dist/messageRepository/api/flagMessage.d.ts.map +1 -1
- package/dist/postRepository/api/flagPost.d.ts +6 -73
- package/dist/postRepository/api/flagPost.d.ts.map +1 -1
- package/dist/postRepository/internalApi/index.d.ts +0 -2
- package/dist/postRepository/internalApi/index.d.ts.map +1 -1
- package/dist/userRepository/api/flagUser.d.ts +9 -50
- package/dist/userRepository/api/flagUser.d.ts.map +1 -1
- package/dist/userRepository/api/index.d.ts +0 -2
- package/dist/userRepository/api/index.d.ts.map +1 -1
- package/dist/utils/tests/dummy/channel.d.ts +0 -4
- package/dist/utils/tests/dummy/channel.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/channelRepository/observers/tests/integrations/getChannelsSortByLastMessage.integration.test.d.ts +0 -2
- package/dist/channelRepository/observers/tests/integrations/getChannelsSortByLastMessage.integration.test.d.ts.map +0 -1
- package/dist/channelRepository/utils/channelActivityOnLoginHandler.d.ts +0 -16
- package/dist/channelRepository/utils/channelActivityOnLoginHandler.d.ts.map +0 -1
- package/dist/channelRepository/utils/tests/integrations/channelActivity.integration.test.d.ts +0 -2
- package/dist/channelRepository/utils/tests/integrations/channelActivity.integration.test.d.ts.map +0 -1
- package/dist/channelRepository/utils/tests/updateChannelActivityTimestamps.test.d.ts +0 -2
- package/dist/channelRepository/utils/tests/updateChannelActivityTimestamps.test.d.ts.map +0 -1
- package/dist/channelRepository/utils/updateChannelActivityTimestamps.d.ts +0 -34
- package/dist/channelRepository/utils/updateChannelActivityTimestamps.d.ts.map +0 -1
- package/dist/commentRepository/internalApi/flagCommentWithOptions.d.ts +0 -13
- package/dist/commentRepository/internalApi/flagCommentWithOptions.d.ts.map +0 -1
- package/dist/commentRepository/internalApi/flagCommentWithReasonString.d.ts +0 -17
- package/dist/commentRepository/internalApi/flagCommentWithReasonString.d.ts.map +0 -1
- package/dist/commentRepository/internalApi/tests/integration/flagCommentWithOptions.integration.test.d.ts +0 -2
- package/dist/commentRepository/internalApi/tests/integration/flagCommentWithOptions.integration.test.d.ts.map +0 -1
- package/dist/commentRepository/internalApi/tests/integration/flagCommentWithReasonString.integration.test.d.ts +0 -2
- package/dist/commentRepository/internalApi/tests/integration/flagCommentWithReasonString.integration.test.d.ts.map +0 -1
- package/dist/core/query/tests/sorting.test.d.ts +0 -2
- package/dist/core/query/tests/sorting.test.d.ts.map +0 -1
- package/dist/core/tests/microtasks.test.d.ts +0 -2
- package/dist/core/tests/microtasks.test.d.ts.map +0 -1
- package/dist/core/transports/tests/integration/serverErrorCodes.integration.test.d.ts +0 -2
- package/dist/core/transports/tests/integration/serverErrorCodes.integration.test.d.ts.map +0 -1
- package/dist/messageRepository/api/tests/integration/flagMessage.overloads.integration.test.d.ts +0 -2
- package/dist/messageRepository/api/tests/integration/flagMessage.overloads.integration.test.d.ts.map +0 -1
- package/dist/messageRepository/internalApi/flagMessageWithOptions.d.ts +0 -13
- package/dist/messageRepository/internalApi/flagMessageWithOptions.d.ts.map +0 -1
- package/dist/messageRepository/internalApi/flagMessageWithReasonString.d.ts +0 -18
- package/dist/messageRepository/internalApi/flagMessageWithReasonString.d.ts.map +0 -1
- package/dist/messageRepository/internalApi/tests/integration/flagMessageWithOptions.integration.test.d.ts +0 -2
- package/dist/messageRepository/internalApi/tests/integration/flagMessageWithOptions.integration.test.d.ts.map +0 -1
- package/dist/messageRepository/internalApi/tests/integration/flagMessageWithReasonString.integration.test.d.ts +0 -2
- package/dist/messageRepository/internalApi/tests/integration/flagMessageWithReasonString.integration.test.d.ts.map +0 -1
- package/dist/postRepository/api/tests/integration/flagPost.overloads.integration.test.d.ts +0 -2
- package/dist/postRepository/api/tests/integration/flagPost.overloads.integration.test.d.ts.map +0 -1
- package/dist/postRepository/internalApi/flagPostWithOptions.d.ts +0 -13
- package/dist/postRepository/internalApi/flagPostWithOptions.d.ts.map +0 -1
- package/dist/postRepository/internalApi/flagPostWithReasonString.d.ts +0 -17
- package/dist/postRepository/internalApi/flagPostWithReasonString.d.ts.map +0 -1
- package/dist/postRepository/internalApi/tests/integration/flagPostWithOptions.integration.test.d.ts +0 -2
- package/dist/postRepository/internalApi/tests/integration/flagPostWithOptions.integration.test.d.ts.map +0 -1
- package/dist/postRepository/internalApi/tests/integration/flagPostWithReasonString.integration.test.d.ts +0 -2
- package/dist/postRepository/internalApi/tests/integration/flagPostWithReasonString.integration.test.d.ts.map +0 -1
- package/dist/userRepository/api/flagUserBehavior.d.ts +0 -29
- package/dist/userRepository/api/flagUserBehavior.d.ts.map +0 -1
- package/dist/userRepository/api/flagUserProfile.d.ts +0 -29
- package/dist/userRepository/api/flagUserProfile.d.ts.map +0 -1
- package/dist/userRepository/api/tests/integration/flagUser.overloads.integration.test.d.ts +0 -2
- package/dist/userRepository/api/tests/integration/flagUser.overloads.integration.test.d.ts.map +0 -1
- package/dist/userRepository/api/tests/integration/flagUserBehavior.integration.test.d.ts +0 -2
- package/dist/userRepository/api/tests/integration/flagUserBehavior.integration.test.d.ts.map +0 -1
- package/dist/userRepository/api/tests/integration/flagUserProfile.integration.test.d.ts +0 -2
- package/dist/userRepository/api/tests/integration/flagUserProfile.integration.test.d.ts.map +0 -1
- package/dist/userRepository/utils/submitUserReport.d.ts +0 -10
- package/dist/userRepository/utils/submitUserReport.d.ts.map +0 -1
- package/dist/userRepository/utils/userReport.d.ts +0 -35
- package/dist/userRepository/utils/userReport.d.ts.map +0 -1
- package/dist/utils/contentFlag.d.ts +0 -28
- package/dist/utils/contentFlag.d.ts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flagPostWithOptions.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/postRepository/internalApi/tests/integration/flagPostWithOptions.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flagPostWithReasonString.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/postRepository/internalApi/tests/integration/flagPostWithReasonString.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,29 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,29 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/dist/userRepository/api/tests/integration/flagUser.overloads.integration.test.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flagUser.overloads.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/userRepository/api/tests/integration/flagUser.overloads.integration.test.ts"],"names":[],"mappings":""}
|
package/dist/userRepository/api/tests/integration/flagUserBehavior.integration.test.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flagUserBehavior.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/userRepository/api/tests/integration/flagUserBehavior.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flagUserProfile.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/userRepository/api/tests/integration/flagUserProfile.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { UserReportBody } from './userReport';
|
|
2
|
-
/**
|
|
3
|
-
* Sends a validated split user report (`flagUserProfile` / `flagUserBehavior`) to the
|
|
4
|
-
* same endpoint as `flagUser`, then persists the returned user and fires `user.flagged`
|
|
5
|
-
* exactly as `flagUser` does, so all three calls share return, cache and event behaviour.
|
|
6
|
-
*
|
|
7
|
-
* Not exported from the public API.
|
|
8
|
-
*/
|
|
9
|
-
export declare const submitUserReport: (apiName: 'flagUserProfile' | 'flagUserBehavior', userId: Amity.User['userId'], body: UserReportBody) => Promise<Amity.User>;
|
|
10
|
-
//# sourceMappingURL=submitUserReport.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"submitUserReport.d.ts","sourceRoot":"","sources":["../../../src/userRepository/utils/submitUserReport.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,YAClB,iBAAiB,GAAG,kBAAkB,UACvC,MAAM,IAAI,CAAC,QAAQ,CAAC,QACtB,cAAc,KACnB,QAAQ,MAAM,IAAI,CAkBpB,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { UserProfileFieldEnum } from '~/@types';
|
|
2
|
-
/** Maximum `comment` length, in string length units, after trimming. */
|
|
3
|
-
export declare const USER_REPORT_COMMENT_MAX_LENGTH = 300;
|
|
4
|
-
/** Request body sent to `POST /api/v4/me/flags/:userId` by the split user-report calls. */
|
|
5
|
-
export declare type UserReportBody = {
|
|
6
|
-
reportType: `${UserProfileFieldEnum}` | 'behavior';
|
|
7
|
-
reason?: string;
|
|
8
|
-
comment?: string;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Normalizes an optional reporter `comment`: it must be a string when supplied (`null`
|
|
12
|
-
* is not a valid supplied comment); it is trimmed; a blank result is omitted (the
|
|
13
|
-
* backend rejects `""`); a result longer than 300 characters is rejected before any
|
|
14
|
-
* request. Otherwise the trimmed text is returned unchanged.
|
|
15
|
-
*
|
|
16
|
-
* @throws {ASCInvalidParameterError} `INVALID_PARAMETERS` for a non-string or over-length comment
|
|
17
|
-
*/
|
|
18
|
-
export declare const normalizeUserReportComment: (apiName: string, comment: unknown) => string | undefined;
|
|
19
|
-
/**
|
|
20
|
-
* Validates `flagUserProfile` options and builds its request body. Untyped callers can
|
|
21
|
-
* pass anything at runtime, so nothing is trusted from the declared type. Any `reason`
|
|
22
|
-
* key is ignored and never sent.
|
|
23
|
-
*
|
|
24
|
-
* @throws {ASCInvalidParameterError} `INVALID_PARAMETERS` when the options are malformed
|
|
25
|
-
*/
|
|
26
|
-
export declare const toUserProfileReportBody: (options: unknown) => UserReportBody;
|
|
27
|
-
/**
|
|
28
|
-
* Validates `flagUserBehavior` options and builds its request body. `reason` must be one
|
|
29
|
-
* of the nine `ContentFlagReasonEnum` values and is sent as that canonical label;
|
|
30
|
-
* `reportType` is always `behavior`.
|
|
31
|
-
*
|
|
32
|
-
* @throws {ASCInvalidParameterError} `INVALID_PARAMETERS` when the options are malformed
|
|
33
|
-
*/
|
|
34
|
-
export declare const toUserBehaviorReportBody: (options: unknown) => UserReportBody;
|
|
35
|
-
//# sourceMappingURL=userReport.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"userReport.d.ts","sourceRoot":"","sources":["../../../src/userRepository/utils/userReport.ts"],"names":[],"mappings":"AACA,OAAO,EAAyB,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEvE,wEAAwE;AACxE,eAAO,MAAM,8BAA8B,MAAM,CAAC;AAElD,2FAA2F;AAC3F,oBAAY,cAAc,GAAG;IAC3B,UAAU,EAAE,GAAG,oBAAoB,EAAE,GAAG,UAAU,CAAC;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAiBF;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,YAC5B,MAAM,WACN,OAAO,KACf,MAAM,GAAG,SAkBX,CAAC;AAKF;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,YAAa,OAAO,KAAG,cAc1D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,YAAa,OAAO,KAAG,cAc3D,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/** Request body shared by the post, comment and message flag endpoints. */
|
|
2
|
-
export declare type ContentFlagBody = {
|
|
3
|
-
reason: string;
|
|
4
|
-
detail?: string;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* True when a public `flagX(id, input)` argument is the legacy shape (a reason string
|
|
8
|
-
* or nothing). Anything else is routed to the `Amity.ContentFlagOptions` path, whose
|
|
9
|
-
* validation rejects malformed values before any request is made.
|
|
10
|
-
*/
|
|
11
|
-
export declare const isLegacyContentFlagReason: (input: unknown) => input is Amity.ContentFlagReason | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* Validates an `Amity.ContentFlagOptions` argument. Untyped (plain JS) callers can pass
|
|
14
|
-
* anything at runtime, so the checks do not trust the declared type: the value must be a
|
|
15
|
-
* plain object, `reason` must be one of the nine `ContentFlagReasonEnum` values and
|
|
16
|
-
* `detail`, when supplied, must be a string (`null` is not a valid supplied detail).
|
|
17
|
-
*
|
|
18
|
-
* @param apiName used in the error message, e.g. `flagPost`
|
|
19
|
-
* @throws {ASCInvalidParameterError} `INVALID_PARAMETERS` when the options are malformed
|
|
20
|
-
*/
|
|
21
|
-
export declare const validateContentFlagOptions: (apiName: string, options: unknown) => Amity.ContentFlagOptions;
|
|
22
|
-
/**
|
|
23
|
-
* Builds the request body for validated options. `detail` is forwarded unchanged (empty
|
|
24
|
-
* and whitespace-only strings included) and omitted from the body when `undefined`; the
|
|
25
|
-
* backend enforces the 300-character limit.
|
|
26
|
-
*/
|
|
27
|
-
export declare const toContentFlagBody: ({ reason, detail }: Amity.ContentFlagOptions) => ContentFlagBody;
|
|
28
|
-
//# sourceMappingURL=contentFlag.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contentFlag.d.ts","sourceRoot":"","sources":["../../src/utils/contentFlag.ts"],"names":[],"mappings":"AAGA,2EAA2E;AAC3E,oBAAY,eAAe,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAIlE;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,UAC7B,OAAO,iDACmF,CAAC;AAEpG;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,YAC5B,MAAM,WACN,OAAO,KACf,MAAM,kBAoBR,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,uBAAwB,MAAM,kBAAkB,KAAG,eACzB,CAAC"}
|