@amityco/ts-sdk-react-native 7.30.1-61b0b52.0 → 7.31.1-e290a45.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 +6 -0
- package/dist/@types/domains/content.d.ts.map +1 -1
- package/dist/index.cjs.js +67 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +65 -6
- package/dist/index.umd.js +1 -1
- 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,6 +7,7 @@ export declare const ContentFeedType: Readonly<{
|
|
|
7
7
|
}>;
|
|
8
8
|
export declare enum ContentFlagReasonEnum {
|
|
9
9
|
CommunityGuidelines = "Against community guidelines",
|
|
10
|
+
ChildEndangerment = "Child endangerment",
|
|
10
11
|
HarassmentOrBullying = "Harassment or bullying",
|
|
11
12
|
SelfHarmOrSuicide = "Self-harm or suicide",
|
|
12
13
|
ViolenceOrThreateningContent = "Violence or threatening content",
|
|
@@ -16,6 +17,11 @@ export declare enum ContentFlagReasonEnum {
|
|
|
16
17
|
FalseInformation = "False information or misinformation",
|
|
17
18
|
Others = "Others"
|
|
18
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Cross-platform name of {@link ContentFlagReasonEnum}, matching `AmityContentFlagReasonType`
|
|
22
|
+
* on Android and iOS. The same enum object and type, not a copy, so either name can be used.
|
|
23
|
+
*/
|
|
24
|
+
export { ContentFlagReasonEnum as AmityContentFlagReasonType };
|
|
19
25
|
declare global {
|
|
20
26
|
namespace Amity {
|
|
21
27
|
type ContentFlagReason = Exclude<`${ContentFlagReasonEnum}`, `${ContentFlagReasonEnum.Others}`> | (string & {});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/@types/domains/content.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe;;;;;;EAM1B,CAAC;AAEH,oBAAY,qBAAqB;IAC/B,mBAAmB,iCAAiC;IACpD,oBAAoB,2BAA2B;IAC/C,iBAAiB,yBAAyB;IAC1C,4BAA4B,oCAAoC;IAChE,sBAAsB,2CAA2C;IACjE,qBAAqB,6BAA6B;IAClD,WAAW,kBAAkB;IAC7B,gBAAgB,wCAAwC;IACxD,MAAM,WAAW;CAClB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK,CAAC;QACd,KAAK,iBAAiB,GAClB,OAAO,CAAC,GAAG,qBAAqB,EAAE,EAAE,GAAG,qBAAqB,CAAC,MAAM,EAAE,CAAC,GACtE,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;QAElB;;;;;;WAMG;QACH,KAAK,kBAAkB,GAAG;YACxB,MAAM,EAAE,qBAAqB,CAAC;YAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;SACjB,CAAC;QAEF,KAAK,WAAW,GACZ,MAAM,GACN,OAAO,GACP,MAAM,GACN,OAAO,GACP,MAAM,GACN,MAAM,GACN,YAAY,GACZ,MAAM,GACN,OAAO,GACP,MAAM,CAAC;QAEX,KAAK,eAAe,GAAG,OAAO,CAAC,OAAO,eAAe,CAAC,CAAC;QAEvD,KAAK,eAAe,GAAG;YACrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;YACtB,IAAI,EAAE,MAAM,CAAC;SACd,CAAC;QAEF,KAAK,eAAe,GAAG;YACrB,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC;SACtC,CAAC;QAEF,KAAK,gBAAgB,GAAG;YACtB,MAAM,EAAE,K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M,GAChB,eAAe,GACf,CAAC,SAAS,OAAO,GACjB,gBAAgB,GAChB,CAAC,SAAS,MAAM,GAChB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACvB,CAAC,SAAS,MAAM,GAChB,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,KAAK,CAAC;QAEV,KAAK,OAAO,CAAC,CAAC,SAAS,WAAW,IAAI;YAEpC,QAAQ,CAAC,EAAE,CAAC,CAAC;YACb,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC;YAChB,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;SACvB,CAAC;QAEF,KAAK,kBAAkB,GAAG;YACxB,WAAW,EAAE,MAAM,CAAC;YACpB,OAAO,EAAE,OAAO,CAAC;SAClB,CAAC;QAEF,KAAK,mBAAmB,GAAG;YACzB,WAAW,EAAE,OAAO,CAAC;YACrB,OAAO,EAAE,OAAO,CAAC;YACjB,kBAAkB,EAAE,MAAM,CAAC;YAC3B,eAAe,EAAE;gBACf,aAAa,EAAE,KAAK,CAAC,eAAe,CAAC;gBACrC,aAAa,EAAE,KAAK,CAAC,eAAe,CAAC;aACtC,CAAC;SACH,CAAC;QAEF,KAAK,cAAc,CAAC,CAAC,SAAS,WAAW,GAAG,MAAM,GAAG,OAAO,IAAI,CAAC,SAAS,MAAM,GAC5E,kBAAkB,GAClB,CAAC,SAAS,OAAO,GACjB,mBAAmB,GACnB,KAAK,CAAC;KACX;CACF"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -182,6 +182,7 @@ const ContentFeedType = Object.freeze({
|
|
|
182
182
|
exports.ContentFlagReasonEnum = void 0;
|
|
183
183
|
(function (ContentFlagReasonEnum) {
|
|
184
184
|
ContentFlagReasonEnum["CommunityGuidelines"] = "Against community guidelines";
|
|
185
|
+
ContentFlagReasonEnum["ChildEndangerment"] = "Child endangerment";
|
|
185
186
|
ContentFlagReasonEnum["HarassmentOrBullying"] = "Harassment or bullying";
|
|
186
187
|
ContentFlagReasonEnum["SelfHarmOrSuicide"] = "Self-harm or suicide";
|
|
187
188
|
ContentFlagReasonEnum["ViolenceOrThreateningContent"] = "Violence or threatening content";
|
|
@@ -380,8 +381,8 @@ exports.AmityLiveViewerCountMode = void 0;
|
|
|
380
381
|
|
|
381
382
|
function getVersion() {
|
|
382
383
|
try {
|
|
383
|
-
// the string ''v7.
|
|
384
|
-
return 'v7.
|
|
384
|
+
// the string ''v7.31.0-cjs'' should be replaced by actual value by @rollup/plugin-replace
|
|
385
|
+
return 'v7.31.0-cjs';
|
|
385
386
|
}
|
|
386
387
|
catch (error) {
|
|
387
388
|
return '__dev__';
|
|
@@ -16087,7 +16088,7 @@ const toUserProfileReportBody = (options) => {
|
|
|
16087
16088
|
};
|
|
16088
16089
|
/**
|
|
16089
16090
|
* Validates `flagUserBehavior` options and builds its request body. `reason` must be one
|
|
16090
|
-
* of the
|
|
16091
|
+
* of the `ContentFlagReasonEnum` values and is sent as that canonical label;
|
|
16091
16092
|
* `reportType` is always `behavior`.
|
|
16092
16093
|
*
|
|
16093
16094
|
* @throws {ASCInvalidParameterError} `INVALID_PARAMETERS` when the options are malformed
|
|
@@ -16168,7 +16169,7 @@ const flagUserProfile = async (userId, options) => submitUserReport('flagUserPro
|
|
|
16168
16169
|
* })
|
|
16169
16170
|
* ```
|
|
16170
16171
|
*
|
|
16171
|
-
* Reports a user's behavior. `reason` is required and is one of the
|
|
16172
|
+
* Reports a user's behavior. `reason` is required and is one of the
|
|
16172
16173
|
* `ContentFlagReasonEnum` values, sent as its canonical label. Reporter text, including
|
|
16173
16174
|
* the explanation for `Others`, always travels in `comment`; the reason never carries text.
|
|
16174
16175
|
*
|
|
@@ -21164,7 +21165,7 @@ const isLegacyContentFlagReason = (input) => input === undefined || typeof input
|
|
|
21164
21165
|
/**
|
|
21165
21166
|
* Validates an `Amity.ContentFlagOptions` argument. Untyped (plain JS) callers can pass
|
|
21166
21167
|
* anything at runtime, so the checks do not trust the declared type: the value must be a
|
|
21167
|
-
* plain object, `reason` must be one of the
|
|
21168
|
+
* plain object, `reason` must be one of the `ContentFlagReasonEnum` values and
|
|
21168
21169
|
* `detail`, when supplied, must be a string (`null` is not a valid supplied detail).
|
|
21169
21170
|
*
|
|
21170
21171
|
* @param apiName used in the error message, e.g. `flagPost`
|
|
@@ -38336,9 +38337,68 @@ class AmityAttachmentProductTags {
|
|
|
38336
38337
|
}
|
|
38337
38338
|
}
|
|
38338
38339
|
|
|
38340
|
+
/**
|
|
38341
|
+
* Stable, cross-platform key per report category. Android and iOS expose the same
|
|
38342
|
+
* keys on `AmityContentFlagReasonType.key`. A UIKit builds its string key from it
|
|
38343
|
+
* (`amity_social_label_report_reason_<key>`), so a released key is never renamed.
|
|
38344
|
+
* The key is not derived from the enum member name on purpose: the existing UIKit
|
|
38345
|
+
* string keys do not follow it (`selling_restricted`, `violence_or_threatening`).
|
|
38346
|
+
*/
|
|
38347
|
+
const CONTENT_FLAG_REASON_KEYS = Object.freeze({
|
|
38348
|
+
[exports.ContentFlagReasonEnum.CommunityGuidelines]: 'community_guidelines',
|
|
38349
|
+
[exports.ContentFlagReasonEnum.ChildEndangerment]: 'child_endangerment',
|
|
38350
|
+
[exports.ContentFlagReasonEnum.HarassmentOrBullying]: 'harassment_or_bullying',
|
|
38351
|
+
[exports.ContentFlagReasonEnum.SelfHarmOrSuicide]: 'self_harm_or_suicide',
|
|
38352
|
+
[exports.ContentFlagReasonEnum.ViolenceOrThreateningContent]: 'violence_or_threatening',
|
|
38353
|
+
[exports.ContentFlagReasonEnum.SellingRestrictedItems]: 'selling_restricted',
|
|
38354
|
+
[exports.ContentFlagReasonEnum.SexualContentOrNudity]: 'sexual_content_or_nudity',
|
|
38355
|
+
[exports.ContentFlagReasonEnum.SpamOrScams]: 'spam_or_scams',
|
|
38356
|
+
[exports.ContentFlagReasonEnum.FalseInformation]: 'false_information',
|
|
38357
|
+
[exports.ContentFlagReasonEnum.Others]: 'others',
|
|
38358
|
+
});
|
|
38359
|
+
/* begin_public_function
|
|
38360
|
+
id: content_flag_reason.get_reasons
|
|
38361
|
+
*/
|
|
38362
|
+
/**
|
|
38363
|
+
* ```js
|
|
38364
|
+
* import { getContentFlagReasons, AmityContentFlagReasonType } from '@amityco/ts-sdk'
|
|
38365
|
+
* const reasons = getContentFlagReasons().filter(r => r !== AmityContentFlagReasonType.Others)
|
|
38366
|
+
* ```
|
|
38367
|
+
*
|
|
38368
|
+
* Returns every report category in display order, with `Others` last. Render a report
|
|
38369
|
+
* picker from this list rather than a copy, so a category added in a later SDK release
|
|
38370
|
+
* appears without a UI change. Each value is also its English default label.
|
|
38371
|
+
*
|
|
38372
|
+
* @returns a new array on every call; mutating it does not affect the SDK
|
|
38373
|
+
*
|
|
38374
|
+
* @category Content Flag
|
|
38375
|
+
*/
|
|
38376
|
+
const getContentFlagReasons = () => Object.values(exports.ContentFlagReasonEnum);
|
|
38377
|
+
/* end_public_function */
|
|
38378
|
+
/* begin_public_function
|
|
38379
|
+
id: content_flag_reason.get_key
|
|
38380
|
+
*/
|
|
38381
|
+
/**
|
|
38382
|
+
* ```js
|
|
38383
|
+
* import { getContentFlagReasonKey, AmityContentFlagReasonType } from '@amityco/ts-sdk'
|
|
38384
|
+
* getContentFlagReasonKey(AmityContentFlagReasonType.ChildEndangerment) // 'child_endangerment'
|
|
38385
|
+
* ```
|
|
38386
|
+
*
|
|
38387
|
+
* Returns the stable, cross-platform key of a report category, for building a
|
|
38388
|
+
* localisation key. Never send the key to the server: flag with the enum value.
|
|
38389
|
+
*
|
|
38390
|
+
* @param reason an `AmityContentFlagReasonType` (`ContentFlagReasonEnum`) value
|
|
38391
|
+
* @returns the category's snake_case key
|
|
38392
|
+
*
|
|
38393
|
+
* @category Content Flag
|
|
38394
|
+
*/
|
|
38395
|
+
const getContentFlagReasonKey = (reason) => CONTENT_FLAG_REASON_KEYS[reason];
|
|
38396
|
+
/* end_public_function */
|
|
38397
|
+
|
|
38339
38398
|
exports.API_REGIONS = API_REGIONS;
|
|
38340
38399
|
exports.AdRepository = index$6;
|
|
38341
38400
|
exports.AmityAttachmentProductTags = AmityAttachmentProductTags;
|
|
38401
|
+
exports.AmityContentFlagReasonType = exports.ContentFlagReasonEnum;
|
|
38342
38402
|
exports.AmityModuleNotEntitledError = AmityModuleNotEntitledError;
|
|
38343
38403
|
exports.CategoryRepository = index$g;
|
|
38344
38404
|
exports.ChannelRepository = index$k;
|
|
@@ -38402,6 +38462,8 @@ exports.getChannelTopic = getChannelTopic;
|
|
|
38402
38462
|
exports.getCommentTopic = getCommentTopic;
|
|
38403
38463
|
exports.getCommunityStoriesTopic = getCommunityStoriesTopic;
|
|
38404
38464
|
exports.getCommunityTopic = getCommunityTopic;
|
|
38465
|
+
exports.getContentFlagReasonKey = getContentFlagReasonKey;
|
|
38466
|
+
exports.getContentFlagReasons = getContentFlagReasons;
|
|
38405
38467
|
exports.getLiveReactionTopic = getLiveReactionTopic;
|
|
38406
38468
|
exports.getLiveStreamTopic = getLiveStreamTopic;
|
|
38407
38469
|
exports.getMarkedMessageTopic = getMarkedMessageTopic;
|
package/dist/index.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export * as EventRepository from './eventRepository';
|
|
|
35
35
|
export * as ProductRepository from './productRepository';
|
|
36
36
|
export * as CuratedContentRepository from './curatedContentRepository';
|
|
37
37
|
export { AmityAttachmentProductTags } from './productRepository/helpers';
|
|
38
|
+
export { getContentFlagReasons, getContentFlagReasonKey } from './utils/contentFlagReason';
|
|
38
39
|
export { AmityModuleNotEntitledError } from './core/errors';
|
|
39
40
|
export { resolveModuleAvailability } from './client/utils/resolveModuleAvailability';
|
|
40
41
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC;AAEzB,cAAc,WAAW,CAAC;AAG1B,cAAc,cAAc,CA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,qBAAqB,CAAC;AACzD,OAAO,KAAK,gBAAgB,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,sBAAsB,MAAM,0BAA0B,CAAC;AAEnE,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAC;AAEnD,OAAO,KAAK,gBAAgB,MAAM,oBAAoB,CAAC;AAEvD,OAAO,KAAK,eAAe,MAAM,mBAAmB,CAAC;AAGrD,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAG/C,cAAc,gBAAgB,CAAC;AAE/B,OAAO,KAAK,gBAAgB,MAAM,oBAAoB,CAAC;AAEvD,OAAO,KAAK,oBAAoB,MAAM,wBAAwB,CAAC;AAE/D,OAAO,KAAK,sBAAsB,MAAM,0BAA0B,CAAC;AAEnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAE3E,OAAO,KAAK,eAAe,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,iBAAiB,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,wBAAwB,MAAM,4BAA4B,CAAC;AAEvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAEzE,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAE3F,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC"}
|
package/dist/index.esm.js
CHANGED
|
@@ -147,6 +147,7 @@ const ContentFeedType = Object.freeze({
|
|
|
147
147
|
var ContentFlagReasonEnum;
|
|
148
148
|
(function (ContentFlagReasonEnum) {
|
|
149
149
|
ContentFlagReasonEnum["CommunityGuidelines"] = "Against community guidelines";
|
|
150
|
+
ContentFlagReasonEnum["ChildEndangerment"] = "Child endangerment";
|
|
150
151
|
ContentFlagReasonEnum["HarassmentOrBullying"] = "Harassment or bullying";
|
|
151
152
|
ContentFlagReasonEnum["SelfHarmOrSuicide"] = "Self-harm or suicide";
|
|
152
153
|
ContentFlagReasonEnum["ViolenceOrThreateningContent"] = "Violence or threatening content";
|
|
@@ -345,8 +346,8 @@ var AmityLiveViewerCountMode;
|
|
|
345
346
|
|
|
346
347
|
function getVersion() {
|
|
347
348
|
try {
|
|
348
|
-
// the string ''v7.
|
|
349
|
-
return 'v7.
|
|
349
|
+
// the string ''v7.31.0-esm'' should be replaced by actual value by @rollup/plugin-replace
|
|
350
|
+
return 'v7.31.0-esm';
|
|
350
351
|
}
|
|
351
352
|
catch (error) {
|
|
352
353
|
return '__dev__';
|
|
@@ -16068,7 +16069,7 @@ const toUserProfileReportBody = (options) => {
|
|
|
16068
16069
|
};
|
|
16069
16070
|
/**
|
|
16070
16071
|
* Validates `flagUserBehavior` options and builds its request body. `reason` must be one
|
|
16071
|
-
* of the
|
|
16072
|
+
* of the `ContentFlagReasonEnum` values and is sent as that canonical label;
|
|
16072
16073
|
* `reportType` is always `behavior`.
|
|
16073
16074
|
*
|
|
16074
16075
|
* @throws {ASCInvalidParameterError} `INVALID_PARAMETERS` when the options are malformed
|
|
@@ -16149,7 +16150,7 @@ const flagUserProfile = async (userId, options) => submitUserReport('flagUserPro
|
|
|
16149
16150
|
* })
|
|
16150
16151
|
* ```
|
|
16151
16152
|
*
|
|
16152
|
-
* Reports a user's behavior. `reason` is required and is one of the
|
|
16153
|
+
* Reports a user's behavior. `reason` is required and is one of the
|
|
16153
16154
|
* `ContentFlagReasonEnum` values, sent as its canonical label. Reporter text, including
|
|
16154
16155
|
* the explanation for `Others`, always travels in `comment`; the reason never carries text.
|
|
16155
16156
|
*
|
|
@@ -21145,7 +21146,7 @@ const isLegacyContentFlagReason = (input) => input === undefined || typeof input
|
|
|
21145
21146
|
/**
|
|
21146
21147
|
* Validates an `Amity.ContentFlagOptions` argument. Untyped (plain JS) callers can pass
|
|
21147
21148
|
* anything at runtime, so the checks do not trust the declared type: the value must be a
|
|
21148
|
-
* plain object, `reason` must be one of the
|
|
21149
|
+
* plain object, `reason` must be one of the `ContentFlagReasonEnum` values and
|
|
21149
21150
|
* `detail`, when supplied, must be a string (`null` is not a valid supplied detail).
|
|
21150
21151
|
*
|
|
21151
21152
|
* @param apiName used in the error message, e.g. `flagPost`
|
|
@@ -38317,4 +38318,62 @@ class AmityAttachmentProductTags {
|
|
|
38317
38318
|
}
|
|
38318
38319
|
}
|
|
38319
38320
|
|
|
38320
|
-
|
|
38321
|
+
/**
|
|
38322
|
+
* Stable, cross-platform key per report category. Android and iOS expose the same
|
|
38323
|
+
* keys on `AmityContentFlagReasonType.key`. A UIKit builds its string key from it
|
|
38324
|
+
* (`amity_social_label_report_reason_<key>`), so a released key is never renamed.
|
|
38325
|
+
* The key is not derived from the enum member name on purpose: the existing UIKit
|
|
38326
|
+
* string keys do not follow it (`selling_restricted`, `violence_or_threatening`).
|
|
38327
|
+
*/
|
|
38328
|
+
const CONTENT_FLAG_REASON_KEYS = Object.freeze({
|
|
38329
|
+
[ContentFlagReasonEnum.CommunityGuidelines]: 'community_guidelines',
|
|
38330
|
+
[ContentFlagReasonEnum.ChildEndangerment]: 'child_endangerment',
|
|
38331
|
+
[ContentFlagReasonEnum.HarassmentOrBullying]: 'harassment_or_bullying',
|
|
38332
|
+
[ContentFlagReasonEnum.SelfHarmOrSuicide]: 'self_harm_or_suicide',
|
|
38333
|
+
[ContentFlagReasonEnum.ViolenceOrThreateningContent]: 'violence_or_threatening',
|
|
38334
|
+
[ContentFlagReasonEnum.SellingRestrictedItems]: 'selling_restricted',
|
|
38335
|
+
[ContentFlagReasonEnum.SexualContentOrNudity]: 'sexual_content_or_nudity',
|
|
38336
|
+
[ContentFlagReasonEnum.SpamOrScams]: 'spam_or_scams',
|
|
38337
|
+
[ContentFlagReasonEnum.FalseInformation]: 'false_information',
|
|
38338
|
+
[ContentFlagReasonEnum.Others]: 'others',
|
|
38339
|
+
});
|
|
38340
|
+
/* begin_public_function
|
|
38341
|
+
id: content_flag_reason.get_reasons
|
|
38342
|
+
*/
|
|
38343
|
+
/**
|
|
38344
|
+
* ```js
|
|
38345
|
+
* import { getContentFlagReasons, AmityContentFlagReasonType } from '@amityco/ts-sdk'
|
|
38346
|
+
* const reasons = getContentFlagReasons().filter(r => r !== AmityContentFlagReasonType.Others)
|
|
38347
|
+
* ```
|
|
38348
|
+
*
|
|
38349
|
+
* Returns every report category in display order, with `Others` last. Render a report
|
|
38350
|
+
* picker from this list rather than a copy, so a category added in a later SDK release
|
|
38351
|
+
* appears without a UI change. Each value is also its English default label.
|
|
38352
|
+
*
|
|
38353
|
+
* @returns a new array on every call; mutating it does not affect the SDK
|
|
38354
|
+
*
|
|
38355
|
+
* @category Content Flag
|
|
38356
|
+
*/
|
|
38357
|
+
const getContentFlagReasons = () => Object.values(ContentFlagReasonEnum);
|
|
38358
|
+
/* end_public_function */
|
|
38359
|
+
/* begin_public_function
|
|
38360
|
+
id: content_flag_reason.get_key
|
|
38361
|
+
*/
|
|
38362
|
+
/**
|
|
38363
|
+
* ```js
|
|
38364
|
+
* import { getContentFlagReasonKey, AmityContentFlagReasonType } from '@amityco/ts-sdk'
|
|
38365
|
+
* getContentFlagReasonKey(AmityContentFlagReasonType.ChildEndangerment) // 'child_endangerment'
|
|
38366
|
+
* ```
|
|
38367
|
+
*
|
|
38368
|
+
* Returns the stable, cross-platform key of a report category, for building a
|
|
38369
|
+
* localisation key. Never send the key to the server: flag with the enum value.
|
|
38370
|
+
*
|
|
38371
|
+
* @param reason an `AmityContentFlagReasonType` (`ContentFlagReasonEnum`) value
|
|
38372
|
+
* @returns the category's snake_case key
|
|
38373
|
+
*
|
|
38374
|
+
* @category Content Flag
|
|
38375
|
+
*/
|
|
38376
|
+
const getContentFlagReasonKey = (reason) => CONTENT_FLAG_REASON_KEYS[reason];
|
|
38377
|
+
/* end_public_function */
|
|
38378
|
+
|
|
38379
|
+
export { API_REGIONS, index$6 as AdRepository, AmityAttachmentProductTags, AmityAutoSubscription, AmityChannelNotificationModeEnum, AmityCommunityType, ContentFlagReasonEnum as AmityContentFlagReasonType, AmityEventOrderOption, AmityEventOriginType, AmityEventResponseStatus, AmityEventSortOption, AmityEventStatus, AmityEventType, AmityLiveViewerCountMode, AmityModuleNotEntitledError, AmitySharableContentType, AnalyticsSourceTypeEnum, index$g as CategoryRepository, index$k as ChannelRepository, index$t as Client, index$f as CommentRepository, CommunityNotificationEventNameEnum, CommunityPostSettingMaps, CommunityPostSettings, index$h as CommunityRepository, ContentFeedType, ContentFlagReasonEnum, index as CuratedContentRepository, DefaultCommunityPostSetting, index$2 as EventRepository, FeedDataTypeEnum, index$e as FeedRepository, FeedSortByEnum, FeedSourceEnum, FeedTypeEnum, FileAccessTypeEnum, index$q as FileRepository, FileType, GET_WATCHER_URLS, index$4 as InvitationRepository, InvitationSortByEnum, InvitationStatusEnum, InvitationTargetTypeEnum, InvitationTypeEnum, JoinRequestStatusEnum, JoinResultStatusEnum, index$3 as LiveReactionRepository, index$8 as LiveStreamPlayer, MembershipAcceptanceTypeEnum, MessageContentType, index$o as MessageRepository, NotificationRolesFilterTypeEnum, NotificationSettingsLevelEnum, index$9 as PollRepository, PostContentType, index$c as PostRepository, PostStructureType, index$1 as ProductRepository, index$p as ReactionRepository, index$a as RoomPresenceRepository, index$d as RoomRepository, SearchUsersByEnum, index$7 as StoryRepository, index$b as StreamRepository, index$n as SubChannelRepository, SubscriptionLevels, UserNotificationModuleNameEnum, UserProfileFieldEnum, UserReportTypeEnum, UserReportTypeFilterEnum, index$r as UserRepository, UserTypeEnum, VERSION, VideoResolution, VideoSize, VideoTranscodingStatus, backupCache, createQuery, createReport, createUserToken, deleteReport, disableCache, dropFromCache, enableCache, exceedsUntilAtBoundary, filterByChannelMembership, filterByCommunityMembership, filterByFeedType, filterByPostDataTypes, filterByPropEquality, filterByPropInclusion, filterByPropIntersection, filterBySearchTerm, filterByStringComparePartially, filterByUntilAt, filterCommentsByBlockUsers, filterPostsByBlockUsers, getBlockUsersId, getChannelTopic, getCommentTopic, getCommunityStoriesTopic, getCommunityTopic, getContentFlagReasonKey, getContentFlagReasons, getLiveReactionTopic, getLiveStreamTopic, getMarkedMessageTopic, getMarkerUserFeedTopic, getMessageTopic, getMyFollowersTopic, getMyFollowingsTopic, getNetworkId, getNetworkTopic, getPostTopic, getRole, getRoomStreamerTopic, getRoomWatcherTopic, getSmartFeedChannelTopic, getSmartFeedMessageTopic, getSmartFeedSubChannelTopic, getStoryTopic, getSubChannelTopic, getUserTopic, isAfterBefore, isAfterBeforeRaw, isCachable, isFetcher, isFresh, isLocal, isMutator, isOffline, isPaged, isReportedByMe, isSkip, mergeInCache, index$5 as notificationTray, onChannelMarkerFetched, onFeedMarkerFetched, onFeedMarkerUpdated, onMessageMarked, onMessageMarkerFetched, onSubChannelMarkerFetched, onSubChannelMarkerUpdated, onUserMarkerFetched, onUserMarkerFetchedLegacy, pullFromCache, pushToCache, queryCache, queryOptions, queryRoles, resolveModuleAvailability, restoreCache, runQuery, sortByChannelSegment, sortByDisplayName, sortByFirstCreated, sortByFirstUpdated, sortByLastActivity, sortByLastCreated, sortByLastMessage, sortByLastUpdated, sortByLocalSortingDate, sortByName, sortBySegmentNumber, subscribeTopic, toPage, toPageRaw, toToken, upsertInCache, validateUntilAt, wipeCache };
|