@amityco/ts-sdk 7.30.0 → 7.30.1-a5f99b06.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/domains/content.d.ts +1 -0
- package/dist/@types/domains/content.d.ts.map +1 -1
- package/dist/index.cjs.js +65 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +64 -5
- package/dist/index.umd.js +2 -2
- package/dist/userRepository/api/flagUserBehavior.d.ts +1 -1
- package/dist/userRepository/utils/userReport.d.ts +1 -1
- package/dist/utils/contentFlag.d.ts +1 -1
- package/dist/utils/contentFlagReason.d.ts +32 -0
- package/dist/utils/contentFlagReason.d.ts.map +1 -0
- package/dist/utils/tests/contentFlagReason.test.d.ts +2 -0
- package/dist/utils/tests/contentFlagReason.test.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* })
|
|
8
8
|
* ```
|
|
9
9
|
*
|
|
10
|
-
* Reports a user's behavior. `reason` is required and is one of the
|
|
10
|
+
* Reports a user's behavior. `reason` is required and is one of the
|
|
11
11
|
* `ContentFlagReasonEnum` values, sent as its canonical label. Reporter text, including
|
|
12
12
|
* the explanation for `Others`, always travels in `comment`; the reason never carries text.
|
|
13
13
|
*
|
|
@@ -26,7 +26,7 @@ export declare const normalizeUserReportComment: (apiName: string, comment: unkn
|
|
|
26
26
|
export declare const toUserProfileReportBody: (options: unknown) => UserReportBody;
|
|
27
27
|
/**
|
|
28
28
|
* Validates `flagUserBehavior` options and builds its request body. `reason` must be one
|
|
29
|
-
* of the
|
|
29
|
+
* of the `ContentFlagReasonEnum` values and is sent as that canonical label;
|
|
30
30
|
* `reportType` is always `behavior`.
|
|
31
31
|
*
|
|
32
32
|
* @throws {ASCInvalidParameterError} `INVALID_PARAMETERS` when the options are malformed
|
|
@@ -12,7 +12,7 @@ export declare const isLegacyContentFlagReason: (input: unknown) => input is Ami
|
|
|
12
12
|
/**
|
|
13
13
|
* Validates an `Amity.ContentFlagOptions` argument. Untyped (plain JS) callers can pass
|
|
14
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
|
|
15
|
+
* plain object, `reason` must be one of the `ContentFlagReasonEnum` values and
|
|
16
16
|
* `detail`, when supplied, must be a string (`null` is not a valid supplied detail).
|
|
17
17
|
*
|
|
18
18
|
* @param apiName used in the error message, e.g. `flagPost`
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ContentFlagReasonEnum } from '~/@types';
|
|
2
|
+
/**
|
|
3
|
+
* ```js
|
|
4
|
+
* import { getContentFlagReasons, ContentFlagReasonEnum } from '@amityco/ts-sdk'
|
|
5
|
+
* const reasons = getContentFlagReasons().filter(r => r !== ContentFlagReasonEnum.Others)
|
|
6
|
+
* ```
|
|
7
|
+
*
|
|
8
|
+
* Returns every report category in display order, with `Others` last. Render a report
|
|
9
|
+
* picker from this list rather than a copy, so a category added in a later SDK release
|
|
10
|
+
* appears without a UI change. Each value is also its English default label.
|
|
11
|
+
*
|
|
12
|
+
* @returns a new array on every call; mutating it does not affect the SDK
|
|
13
|
+
*
|
|
14
|
+
* @category Content Flag
|
|
15
|
+
*/
|
|
16
|
+
export declare const getContentFlagReasons: () => ContentFlagReasonEnum[];
|
|
17
|
+
/**
|
|
18
|
+
* ```js
|
|
19
|
+
* import { getContentFlagReasonKey, ContentFlagReasonEnum } from '@amityco/ts-sdk'
|
|
20
|
+
* getContentFlagReasonKey(ContentFlagReasonEnum.ChildEndangerment) // 'child_endangerment'
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* Returns the stable, cross-platform key of a report category, for building a
|
|
24
|
+
* localisation key. Never send the key to the server: flag with the enum value.
|
|
25
|
+
*
|
|
26
|
+
* @param reason a `ContentFlagReasonEnum` value
|
|
27
|
+
* @returns the category's snake_case key
|
|
28
|
+
*
|
|
29
|
+
* @category Content Flag
|
|
30
|
+
*/
|
|
31
|
+
export declare const getContentFlagReasonKey: (reason: ContentFlagReasonEnum) => string;
|
|
32
|
+
//# sourceMappingURL=contentFlagReason.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contentFlagReason.d.ts","sourceRoot":"","sources":["../../src/utils/contentFlagReason.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAyBjD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qBAAqB,QAAO,qBAAqB,EACxB,CAAC;AAMvC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,uBAAuB,WAAY,qBAAqB,KAAG,MACtC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contentFlagReason.test.d.ts","sourceRoot":"","sources":["../../../src/utils/tests/contentFlagReason.test.ts"],"names":[],"mappings":""}
|