@amityco/ts-sdk-react-native 7.24.1-c018455.0 → 7.25.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.
@@ -2,14 +2,20 @@
2
2
  * ```js
3
3
  * import { createReport } from '@amityco/ts-sdk-react-native'
4
4
  * const flagged = await createReport('post', postId)
5
+ * const flaggedUser = await createReport('user', userId, {
6
+ * reportType: 'behavior',
7
+ * reason: 'Harassment or bullying',
8
+ * })
5
9
  * ```
6
10
  *
7
11
  * @param referenceType The type of thing to add a report to, such as a post or a comment.
8
12
  * @param referenceId The ID of the thing to add a new report to.
13
+ * @param options Optional report metadata. Only honored when `referenceType === 'user'`.
14
+ * See `UserRepository.flagUser` for the accepted shape and validation rules.
9
15
  * @returns the created report result
10
16
  *
11
17
  * @category Report API
12
18
  * @async
13
19
  * */
14
- export declare const createReport: (referenceType: 'post' | 'comment' | 'message' | 'user', referenceId: string) => Promise<boolean>;
20
+ export declare const createReport: (referenceType: 'post' | 'comment' | 'message' | 'user', referenceId: string, options?: Amity.UserReportOptions) => Promise<boolean>;
15
21
  //# sourceMappingURL=createReport.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createReport.d.ts","sourceRoot":"","sources":["../../../src/report/api/createReport.ts"],"names":[],"mappings":"AA6FA;;;;;;;;;;;;KAYK;AACL,eAAO,MAAM,YAAY,kBACR,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,eACzC,MAAM,KAClB,QAAQ,OAAO,CAqBjB,CAAC"}
1
+ {"version":3,"file":"createReport.d.ts","sourceRoot":"","sources":["../../../src/report/api/createReport.ts"],"names":[],"mappings":"AAgFA;;;;;;;;;;;;;;;;;;KAkBK;AACL,eAAO,MAAM,YAAY,kBACR,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,eACzC,MAAM,YACT,MAAM,iBAAiB,KAChC,QAAQ,OAAO,CAqBjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"onRoomParticipantLeft.d.ts","sourceRoot":"","sources":["../../../src/roomRepository/events/onRoomParticipantLeft.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,qBAAqB,aACtB,MAAM,QAAQ,CAAC,MAAM,WAAW,CAAC,KAC1C,MAAM,YAkBR,CAAC"}
1
+ {"version":3,"file":"onRoomParticipantLeft.d.ts","sourceRoot":"","sources":["../../../src/roomRepository/events/onRoomParticipantLeft.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,qBAAqB,aACtB,MAAM,QAAQ,CAAC,MAAM,WAAW,CAAC,KAC1C,MAAM,YAoBR,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"onRoomParticipantRemoved.d.ts","sourceRoot":"","sources":["../../../src/roomRepository/events/onRoomParticipantRemoved.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,wBAAwB,aACzB,MAAM,QAAQ,CAAC,MAAM,WAAW,CAAC,KAC1C,MAAM,YAkBR,CAAC"}
1
+ {"version":3,"file":"onRoomParticipantRemoved.d.ts","sourceRoot":"","sources":["../../../src/roomRepository/events/onRoomParticipantRemoved.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,wBAAwB,aACzB,MAAM,QAAQ,CAAC,MAAM,WAAW,CAAC,KAC1C,MAAM,YAoBR,CAAC"}
@@ -2,13 +2,21 @@
2
2
  * ```js
3
3
  * import { UserRepository } from '@amityco/ts-sdk-react-native'
4
4
  * const flagged = await UserRepository.flagUser('userId')
5
+ * const flaggedBehavior = await UserRepository.flagUser('userId', {
6
+ * reportType: 'behavior',
7
+ * reason: 'Harassment or bullying',
8
+ * comment: 'optional free-text',
9
+ * })
5
10
  * ```
6
11
  *
7
- * @param userId The ID of the user to add a be flagged
8
- * @returns the created report result
12
+ * @param userId The ID of the user to be flagged
13
+ * @param options Optional report metadata forwarded to the server as the request
14
+ * body: `reportType`, `reason`, `comment`. Only non-null fields are included.
15
+ * All validation is server-side; a bodyless call produces a typeless report.
16
+ * @returns the flagged {@link Amity.User}
9
17
  *
10
18
  * @category User API
11
19
  * @async
12
20
  * */
13
- export declare const flagUser: (userId: Amity.User['userId']) => Promise<boolean>;
21
+ export declare const flagUser: (userId: Amity.User['userId'], options?: Amity.UserReportOptions) => Promise<Amity.User>;
14
22
  //# sourceMappingURL=flagUser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"flagUser.d.ts","sourceRoot":"","sources":["../../../src/userRepository/api/flagUser.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;KAWK;AACL,eAAO,MAAM,QAAQ,WAAkB,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAG,QAAQ,OAAO,CAiB5E,CAAC"}
1
+ {"version":3,"file":"flagUser.d.ts","sourceRoot":"","sources":["../../../src/userRepository/api/flagUser.ts"],"names":[],"mappings":"AAoBA;;;;;;;;;;;;;;;;;;;KAmBK;AACL,eAAO,MAAM,QAAQ,WACX,MAAM,IAAI,CAAC,QAAQ,CAAC,YAClB,MAAM,iBAAiB,KAChC,QAAQ,MAAM,IAAI,CAoBpB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amityco/ts-sdk-react-native",
3
- "version": "7.24.1-c018455.0",
3
+ "version": "7.25.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",
@@ -83,7 +83,7 @@
83
83
  "jwt-decode": "^3.1.2",
84
84
  "mime": "3.0.0",
85
85
  "mitt": "^3.0.0",
86
- "mqtt": "^4.3.7",
86
+ "mqtt": "^5.15.2",
87
87
  "object-hash": "^3.0.0",
88
88
  "react-native-uuid": "^2.0.1",
89
89
  "ts-jest": "^28.0.3"