@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.
@@ -7,7 +7,7 @@
7
7
  * })
8
8
  * ```
9
9
  *
10
- * Reports a user's behavior. `reason` is required and is one of the nine
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 nine `ContentFlagReasonEnum` values and is sent as that canonical label;
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 nine `ContentFlagReasonEnum` values and
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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=contentFlagReason.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contentFlagReason.test.d.ts","sourceRoot":"","sources":["../../../src/utils/tests/contentFlagReason.test.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amityco/ts-sdk",
3
- "version": "7.30.0",
3
+ "version": "7.30.1-a5f99b06.0",
4
4
  "license": "CC-BY-ND-4.0",
5
5
  "author": "amity.co <developers@amity.co> (https://amity.co)",
6
6
  "description": "Amity Social Cloud Typescript SDK",