@amityco/ts-sdk-react-native 6.24.2-d89a258.0 → 6.25.1
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/.env +26 -26
- package/dist/@types/core/events.d.ts +2 -0
- package/dist/@types/core/events.d.ts.map +1 -1
- package/dist/@types/core/model.d.ts +4 -2
- package/dist/@types/core/model.d.ts.map +1 -1
- package/dist/@types/core/payload.d.ts +2 -1
- package/dist/@types/core/payload.d.ts.map +1 -1
- package/dist/@types/domains/stream.d.ts +19 -3
- package/dist/@types/domains/stream.d.ts.map +1 -1
- package/dist/client/api/index.d.ts +2 -0
- package/dist/client/api/index.d.ts.map +1 -1
- package/dist/client/api/registerPushNotification.d.ts +2 -0
- package/dist/client/api/registerPushNotification.d.ts.map +1 -0
- package/dist/client/api/unregisterPushNotification.d.ts +2 -0
- package/dist/client/api/unregisterPushNotification.d.ts.map +1 -0
- package/dist/core/events.d.ts +3 -3
- package/dist/core/events.d.ts.map +1 -1
- package/dist/core/model/idResolvers.d.ts.map +1 -1
- package/dist/core/model/index.d.ts.map +1 -1
- package/dist/index.cjs.js +145 -25
- package/dist/index.esm.js +145 -25
- package/dist/index.umd.js +3 -4
- package/dist/reactionRepository/events/onReactionAdded.d.ts.map +1 -1
- package/dist/reactionRepository/events/onReactorAdded.d.ts.map +1 -1
- package/dist/reactionRepository/events/onReactorRemoved.d.ts.map +1 -1
- package/dist/streamRepository/api/createStream.d.ts +4 -4
- package/dist/streamRepository/api/createStream.d.ts.map +1 -1
- package/dist/streamRepository/api/deleteStream.d.ts +4 -4
- package/dist/streamRepository/api/deleteStream.d.ts.map +1 -1
- package/dist/streamRepository/api/disposeStream.d.ts +4 -4
- package/dist/streamRepository/api/disposeStream.d.ts.map +1 -1
- package/dist/streamRepository/api/queryStreams.d.ts +4 -4
- package/dist/streamRepository/api/queryStreams.d.ts.map +1 -1
- package/dist/streamRepository/api/updateStream.d.ts.map +1 -1
- package/dist/streamRepository/events/index.d.ts +2 -0
- package/dist/streamRepository/events/index.d.ts.map +1 -1
- package/dist/streamRepository/events/onStreamFlagged.d.ts +17 -0
- package/dist/streamRepository/events/onStreamFlagged.d.ts.map +1 -0
- package/dist/streamRepository/events/onStreamRecorded.d.ts +2 -2
- package/dist/streamRepository/events/onStreamRecorded.d.ts.map +1 -1
- package/dist/streamRepository/events/onStreamStarted.d.ts +2 -2
- package/dist/streamRepository/events/onStreamStarted.d.ts.map +1 -1
- package/dist/streamRepository/events/onStreamStopped.d.ts +2 -2
- package/dist/streamRepository/events/onStreamStopped.d.ts.map +1 -1
- package/dist/streamRepository/events/onStreamTerminated.d.ts +17 -0
- package/dist/streamRepository/events/onStreamTerminated.d.ts.map +1 -0
- package/dist/streamRepository/internalApi/queryStreams.d.ts +3 -3
- package/dist/streamRepository/internalApi/queryStreams.d.ts.map +1 -1
- package/dist/streamRepository/observers/getStreamById.d.ts +1 -0
- package/dist/streamRepository/observers/getStreamById.d.ts.map +1 -1
- package/dist/streamRepository/observers/getStreams/GetStreamsLiveCollectionController.d.ts +14 -0
- package/dist/streamRepository/observers/getStreams/GetStreamsLiveCollectionController.d.ts.map +1 -0
- package/dist/streamRepository/observers/getStreams/GetStreamsPageController.d.ts +14 -0
- package/dist/streamRepository/observers/getStreams/GetStreamsPageController.d.ts.map +1 -0
- package/dist/streamRepository/observers/getStreams/GetStreamsQueryStreamController.d.ts +15 -0
- package/dist/streamRepository/observers/getStreams/GetStreamsQueryStreamController.d.ts.map +1 -0
- package/dist/streamRepository/observers/getStreams/getStreams.d.ts +2 -0
- package/dist/streamRepository/observers/getStreams/getStreams.d.ts.map +1 -0
- package/dist/streamRepository/observers/getStreams/index.d.ts +2 -0
- package/dist/streamRepository/observers/getStreams/index.d.ts.map +1 -0
- package/dist/utils/linkedObject/index.d.ts +1 -0
- package/dist/utils/linkedObject/index.d.ts.map +1 -1
- package/dist/utils/linkedObject/streamLinkedObject.d.ts +2 -0
- package/dist/utils/linkedObject/streamLinkedObject.d.ts.map +1 -0
- package/package.json +3 -1
- package/rollup.config.js +6 -0
- package/src/@types/core/events.ts +5 -1
- package/src/@types/core/model.ts +4 -2
- package/src/@types/core/payload.ts +2 -1
- package/src/@types/domains/stream.ts +23 -3
- package/src/client/api/index.ts +3 -0
- package/src/client/api/registerPushNotification.ts +37 -0
- package/src/client/api/unregisterPushNotification.ts +26 -0
- package/src/core/model/idResolvers.ts +1 -0
- package/src/core/model/index.ts +1 -0
- package/src/reactionRepository/events/onReactionAdded.ts +0 -1
- package/src/reactionRepository/events/onReactorAdded.ts +7 -1
- package/src/reactionRepository/events/onReactorRemoved.ts +6 -1
- package/src/streamRepository/api/createStream.ts +8 -5
- package/src/streamRepository/api/deleteStream.ts +6 -4
- package/src/streamRepository/api/disposeStream.ts +5 -5
- package/src/streamRepository/api/queryStreams.ts +4 -4
- package/src/streamRepository/api/updateStream.ts +2 -1
- package/src/streamRepository/events/index.ts +2 -0
- package/src/streamRepository/events/onStreamFlagged.ts +37 -0
- package/src/streamRepository/events/onStreamRecorded.ts +4 -2
- package/src/streamRepository/events/onStreamStarted.ts +4 -2
- package/src/streamRepository/events/onStreamStopped.ts +4 -2
- package/src/streamRepository/events/onStreamTerminated.ts +37 -0
- package/src/streamRepository/internalApi/queryStreams.ts +3 -3
- package/src/streamRepository/observers/getStreamById.ts +18 -5
- package/src/streamRepository/observers/getStreams/GetStreamsLiveCollectionController.ts +114 -0
- package/src/streamRepository/observers/getStreams/GetStreamsPageController.ts +23 -0
- package/src/streamRepository/observers/getStreams/GetStreamsQueryStreamController.ts +83 -0
- package/src/streamRepository/observers/getStreams/getStreams.ts +32 -0
- package/src/streamRepository/observers/getStreams/index.ts +1 -0
- package/src/streamRepository/observers/tests/getStreamById.test.ts +1 -1
- package/src/utils/linkedObject/index.ts +2 -0
- package/src/utils/linkedObject/streamLinkedObject.ts +11 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onReactionAdded.d.ts","sourceRoot":"","sources":["../../../src/reactionRepository/events/onReactionAdded.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"onReactionAdded.d.ts","sourceRoot":"","sources":["../../../src/reactionRepository/events/onReactionAdded.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;KAgBK;AACL,eAAO,MAAM,eAAe,kBACX,MAAM,aAAa,eACrB,MAAM,QAAQ,CAAC,aAAa,CAAC,wIAEzC,MAAM,YAuCR,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onReactorAdded.d.ts","sourceRoot":"","sources":["../../../src/reactionRepository/events/onReactorAdded.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;KAgBK;AACL,eAAO,MAAM,cAAc,kBACV,MAAM,aAAa,eACrB,MAAM,QAAQ,CAAC,aAAa,CAAC,YAChC,MAAM,QAAQ,CAAC,MAAM,eAAe,CAAC,KAC9C,MAAM,
|
|
1
|
+
{"version":3,"file":"onReactorAdded.d.ts","sourceRoot":"","sources":["../../../src/reactionRepository/events/onReactorAdded.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;KAgBK;AACL,eAAO,MAAM,cAAc,kBACV,MAAM,aAAa,eACrB,MAAM,QAAQ,CAAC,aAAa,CAAC,YAChC,MAAM,QAAQ,CAAC,MAAM,eAAe,CAAC,KAC9C,MAAM,YAoER,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onReactorRemoved.d.ts","sourceRoot":"","sources":["../../../src/reactionRepository/events/onReactorRemoved.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;KAgBK;AACL,eAAO,MAAM,gBAAgB,kBACZ,MAAM,aAAa,eACrB,MAAM,QAAQ,CAAC,aAAa,CAAC,YAChC,MAAM,QAAQ,CAAC,MAAM,eAAe,CAAC,KAC9C,MAAM,
|
|
1
|
+
{"version":3,"file":"onReactorRemoved.d.ts","sourceRoot":"","sources":["../../../src/reactionRepository/events/onReactorRemoved.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;KAgBK;AACL,eAAO,MAAM,gBAAgB,kBACZ,MAAM,aAAa,eACrB,MAAM,QAAQ,CAAC,aAAa,CAAC,YAChC,MAAM,QAAQ,CAAC,MAAM,eAAe,CAAC,KAC9C,MAAM,YAuER,CAAC"}
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
* const created = await createStream({ title: 'my stream', 'thumbnailFileId': fileId })
|
|
5
5
|
* ```
|
|
6
6
|
*
|
|
7
|
-
* Creates an {@link Amity.
|
|
7
|
+
* Creates an {@link Amity.InternalStream}
|
|
8
8
|
*
|
|
9
|
-
* @param bundle The data necessary to create a new {@link Amity.
|
|
10
|
-
* @returns The newly created {@link Amity.
|
|
9
|
+
* @param bundle The data necessary to create a new {@link Amity.InternalStream}
|
|
10
|
+
* @returns The newly created {@link Amity.InternalStream}
|
|
11
11
|
*
|
|
12
12
|
* @category Stream API
|
|
13
13
|
* @async
|
|
14
14
|
*/
|
|
15
|
-
export declare const createStream: (bundle: Pick<Amity.
|
|
15
|
+
export declare const createStream: (bundle: Pick<Amity.InternalStream, 'title' | 'thumbnailFileId' | 'description'> & {
|
|
16
16
|
isSecure?: boolean;
|
|
17
17
|
}) => Promise<Amity.Cached<Amity.Stream>>;
|
|
18
18
|
//# sourceMappingURL=createStream.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createStream.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/api/createStream.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createStream.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/api/createStream.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,WACf,KAAK,MAAM,cAAc,EAAE,OAAO,GAAG,iBAAiB,GAAG,aAAa,CAAC,GAAG;IAChF,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,KACA,QAAQ,MAAM,MAAM,CAAC,MAAM,MAAM,CAAC,CAepC,CAAC"}
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* const success = await deleteStream(streamId)
|
|
5
5
|
* ```
|
|
6
6
|
*
|
|
7
|
-
* Deletes a {@link Amity.
|
|
7
|
+
* Deletes a {@link Amity.InternalStream}
|
|
8
8
|
*
|
|
9
|
-
* @param streamId The {@link Amity.
|
|
10
|
-
* @return A success boolean if the {@link Amity.
|
|
9
|
+
* @param streamId The {@link Amity.InternalStream} ID to delete
|
|
10
|
+
* @return A success boolean if the {@link Amity.InternalStream} was deleted
|
|
11
11
|
*
|
|
12
12
|
* @category Stream API
|
|
13
13
|
* @async
|
|
14
14
|
*/
|
|
15
|
-
export declare const deleteStream: (streamId: Amity.
|
|
15
|
+
export declare const deleteStream: (streamId: Amity.InternalStream['streamId']) => Promise<boolean>;
|
|
16
16
|
//# sourceMappingURL=deleteStream.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deleteStream.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/api/deleteStream.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"deleteStream.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/api/deleteStream.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,aACb,MAAM,cAAc,CAAC,UAAU,CAAC,KACzC,QAAQ,OAAO,CAkBjB,CAAC"}
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
* const stream = await disposeStream(streamId)
|
|
5
5
|
* ```
|
|
6
6
|
*
|
|
7
|
-
* Dispose a {@link Amity.
|
|
7
|
+
* Dispose a {@link Amity.InternalStream}.
|
|
8
8
|
* Streaming status will be updated to "ended" and streaming url will be invalidated
|
|
9
9
|
*
|
|
10
|
-
* @param streamId The {@link Amity.
|
|
11
|
-
* @returns the associated {@link Amity.
|
|
10
|
+
* @param streamId The {@link Amity.InternalStream} ID to dispose
|
|
11
|
+
* @returns the associated {@link Amity.InternalStream} object
|
|
12
12
|
*
|
|
13
13
|
* @category Stream API
|
|
14
14
|
* @async
|
|
15
15
|
*/
|
|
16
|
-
export declare const disposeStream: (streamId: Amity.
|
|
16
|
+
export declare const disposeStream: (streamId: Amity.InternalStream['streamId']) => Promise<Amity.Cached<Amity.InternalStream>>;
|
|
17
17
|
//# sourceMappingURL=disposeStream.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disposeStream.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/api/disposeStream.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,aACd,MAAM,
|
|
1
|
+
{"version":3,"file":"disposeStream.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/api/disposeStream.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,aACd,MAAM,cAAc,CAAC,UAAU,CAAC,KACzC,QAAQ,MAAM,MAAM,CAAC,MAAM,cAAc,CAAC,CAiB5C,CAAC"}
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
* const streams = await getStreams()
|
|
7
7
|
* ```
|
|
8
8
|
*
|
|
9
|
-
* Queries a paginable list of {@link Amity.
|
|
9
|
+
* Queries a paginable list of {@link Amity.InternalStream} objects
|
|
10
10
|
*
|
|
11
11
|
* @param query The query parameters
|
|
12
|
-
* @returns A page of {@link Amity.
|
|
12
|
+
* @returns A page of {@link Amity.InternalStream} objects
|
|
13
13
|
*
|
|
14
14
|
* @category Stream API
|
|
15
15
|
* @async
|
|
@@ -19,7 +19,7 @@ export declare const queryStreams: (query?: {
|
|
|
19
19
|
statuses?: Amity.StreamStatus[];
|
|
20
20
|
userPublicIds?: Amity.InternalUser['userId'][];
|
|
21
21
|
sortBy?: 'lastCreated' | 'firstCreated';
|
|
22
|
-
isDeleted?: Amity.
|
|
22
|
+
isDeleted?: Amity.InternalStream['isDeleted'];
|
|
23
23
|
page?: Amity.Page;
|
|
24
|
-
}) => Promise<Amity.Cached<Amity.Paged<Amity.
|
|
24
|
+
}) => Promise<Amity.Cached<Amity.Paged<Amity.InternalStream>>>;
|
|
25
25
|
//# sourceMappingURL=queryStreams.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryStreams.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/api/queryStreams.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,YAAY,WAAkB;IACzC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,YAAY,EAAE,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC;IAC/C,MAAM,CAAC,EAAE,aAAa,GAAG,cAAc,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"queryStreams.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/api/queryStreams.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,YAAY,WAAkB;IACzC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,YAAY,EAAE,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC;IAC/C,MAAM,CAAC,EAAE,aAAa,GAAG,cAAc,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,cAAc,CAAC,WAAW,CAAC,CAAC;IAC9C,IAAI,CAAC,EAAE,MAAM,IAAI,CAAC;CACnB,KAAG,QAAQ,MAAM,MAAM,CAAC,MAAM,KAAK,CAAC,MAAM,cAAc,CAAC,CAAC,CA8B1D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateStream.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/api/updateStream.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"updateStream.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/api/updateStream.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,YAAY,aACb,MAAM,MAAM,CAAC,UAAU,CAAC,SAC3B,MAAM,MAAM,MAAM,EAAE,OAAO,GAAG,iBAAiB,GAAG,aAAa,GAAG,UAAU,CAAC,KACnF,QAAQ,MAAM,MAAM,CAAC,MAAM,MAAM,CAAC,CAkBpC,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { onStreamStarted } from './onStreamStarted';
|
|
2
2
|
export { onStreamStopped } from './onStreamStopped';
|
|
3
3
|
export { onStreamRecorded } from './onStreamRecorded';
|
|
4
|
+
export { onStreamFlagged } from './onStreamFlagged';
|
|
5
|
+
export { onStreamTerminated } from './onStreamTerminated';
|
|
4
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/events/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/events/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ```js
|
|
3
|
+
* import { onStreamFlagged } from '@amityco/ts-sdk-react-native'
|
|
4
|
+
* const dispose = onStreamFlagged(stream => {
|
|
5
|
+
* // ...
|
|
6
|
+
* })
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* Fired when a {@link Amity.InternalStream} has started airing
|
|
10
|
+
*
|
|
11
|
+
* @param callback The function to call when the event was fired
|
|
12
|
+
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
13
|
+
*
|
|
14
|
+
* @category Stream Events
|
|
15
|
+
*/
|
|
16
|
+
export declare const onStreamFlagged: (callback: Amity.Listener<Amity.InternalStream>) => Amity.Unsubscriber;
|
|
17
|
+
//# sourceMappingURL=onStreamFlagged.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onStreamFlagged.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/events/onStreamFlagged.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,eAAe,aAChB,MAAM,QAAQ,CAAC,MAAM,cAAc,CAAC,KAC7C,MAAM,YAcR,CAAC"}
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
* })
|
|
7
7
|
* ```
|
|
8
8
|
*
|
|
9
|
-
* Fired when the recordings of a {@link Amity.
|
|
9
|
+
* Fired when the recordings of a {@link Amity.InternalStream} are available
|
|
10
10
|
*
|
|
11
11
|
* @param callback The function to call when the event was fired
|
|
12
12
|
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
13
13
|
*
|
|
14
14
|
* @category Stream Events
|
|
15
15
|
*/
|
|
16
|
-
export declare const onStreamRecorded: (callback: Amity.Listener<Amity.
|
|
16
|
+
export declare const onStreamRecorded: (callback: Amity.Listener<Amity.InternalStream>) => Amity.Unsubscriber;
|
|
17
17
|
//# sourceMappingURL=onStreamRecorded.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onStreamRecorded.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/events/onStreamRecorded.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"onStreamRecorded.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/events/onStreamRecorded.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,aACjB,MAAM,QAAQ,CAAC,MAAM,cAAc,CAAC,KAC7C,MAAM,YAcR,CAAC"}
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
* })
|
|
7
7
|
* ```
|
|
8
8
|
*
|
|
9
|
-
* Fired when a {@link Amity.
|
|
9
|
+
* Fired when a {@link Amity.InternalStream} has started airing
|
|
10
10
|
*
|
|
11
11
|
* @param callback The function to call when the event was fired
|
|
12
12
|
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
13
13
|
*
|
|
14
14
|
* @category Stream Events
|
|
15
15
|
*/
|
|
16
|
-
export declare const onStreamStarted: (callback: Amity.Listener<Amity.
|
|
16
|
+
export declare const onStreamStarted: (callback: Amity.Listener<Amity.InternalStream>) => Amity.Unsubscriber;
|
|
17
17
|
//# sourceMappingURL=onStreamStarted.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onStreamStarted.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/events/onStreamStarted.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"onStreamStarted.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/events/onStreamStarted.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,eAAe,aAChB,MAAM,QAAQ,CAAC,MAAM,cAAc,CAAC,KAC7C,MAAM,YAcR,CAAC"}
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
* })
|
|
7
7
|
* ```
|
|
8
8
|
*
|
|
9
|
-
* Fired when a {@link Amity.
|
|
9
|
+
* Fired when a {@link Amity.InternalStream} has stopped airing
|
|
10
10
|
*
|
|
11
11
|
* @param callback The function to call when the event was fired
|
|
12
12
|
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
13
13
|
*
|
|
14
14
|
* @category Stream Events
|
|
15
15
|
*/
|
|
16
|
-
export declare const onStreamStopped: (callback: Amity.Listener<Amity.
|
|
16
|
+
export declare const onStreamStopped: (callback: Amity.Listener<Amity.InternalStream>) => Amity.Unsubscriber;
|
|
17
17
|
//# sourceMappingURL=onStreamStopped.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onStreamStopped.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/events/onStreamStopped.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"onStreamStopped.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/events/onStreamStopped.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,eAAe,aAChB,MAAM,QAAQ,CAAC,MAAM,cAAc,CAAC,KAC7C,MAAM,YAcR,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ```js
|
|
3
|
+
* import { onStreamTerminated } from '@amityco/ts-sdk-react-native'
|
|
4
|
+
* const dispose = onStreamTerminated(stream => {
|
|
5
|
+
* // ...
|
|
6
|
+
* })
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* Fired when a {@link Amity.InternalStream} has started airing
|
|
10
|
+
*
|
|
11
|
+
* @param callback The function to call when the event was fired
|
|
12
|
+
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
13
|
+
*
|
|
14
|
+
* @category Stream Events
|
|
15
|
+
*/
|
|
16
|
+
export declare const onStreamTerminated: (callback: Amity.Listener<Amity.InternalStream>) => Amity.Unsubscriber;
|
|
17
|
+
//# sourceMappingURL=onStreamTerminated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onStreamTerminated.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/events/onStreamTerminated.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,kBAAkB,aACnB,MAAM,QAAQ,CAAC,MAAM,cAAc,CAAC,KAC7C,MAAM,YAcR,CAAC"}
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* const streams = await getStreams()
|
|
5
5
|
* ```
|
|
6
6
|
*
|
|
7
|
-
* Queries a paginable list of {@link Amity.
|
|
7
|
+
* Queries a paginable list of {@link Amity.InternalStream} objects
|
|
8
8
|
*
|
|
9
9
|
* @param query The query parameters
|
|
10
|
-
* @returns A page of {@link Amity.
|
|
10
|
+
* @returns A page of {@link Amity.InternalStream} objects
|
|
11
11
|
*
|
|
12
12
|
* @category Stream API
|
|
13
13
|
* @async
|
|
14
14
|
*/
|
|
15
|
-
export declare const queryStreams: (query?: Amity.QueryStreams) => Promise<Amity.Cached<Amity.PageToken<Amity.
|
|
15
|
+
export declare const queryStreams: (query?: Amity.QueryStreams) => Promise<Amity.Cached<Amity.PageToken<Amity.InternalStream>>>;
|
|
16
16
|
//# sourceMappingURL=queryStreams.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryStreams.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/internalApi/queryStreams.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,WACf,MAAM,YAAY,KACzB,QAAQ,MAAM,MAAM,CAAC,MAAM,SAAS,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"queryStreams.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/internalApi/queryStreams.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,WACf,MAAM,YAAY,KACzB,QAAQ,MAAM,MAAM,CAAC,MAAM,SAAS,CAAC,MAAM,cAAc,CAAC,CAAC,CAgC7D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getStreamById.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/observers/getStreamById.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getStreamById.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/observers/getStreamById.ts"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,aAAa;eACd,MAAM,MAAM,CAAC,UAAU,CAAC,YACxB,MAAM,kBAAkB,CAAC,MAAM,MAAM,CAAC,GAC/C,MAAM,YAAY;IAkBrB;;;;;;;;;;;;OAYG;sBAES,MAAM,MAAM,CAAC,UAAU,CAAC,GACjC,MAAM,MAAM,CAAC,MAAM,MAAM,CAAC,GAAG,SAAS;CAlBxC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LiveCollectionController } from '~/core/liveCollection/LiveCollectionController';
|
|
2
|
+
import { GetStreamsPageController } from '~/streamRepository/observers/getStreams/GetStreamsPageController';
|
|
3
|
+
export declare class GetStreamsLiveCollectionController extends LiveCollectionController<'stream', Amity.StreamLiveCollection, Amity.Stream, GetStreamsPageController> {
|
|
4
|
+
private queryStreamController;
|
|
5
|
+
private query;
|
|
6
|
+
constructor(query: Amity.StreamLiveCollection, callback: Amity.LiveCollectionCallback<Amity.Stream>);
|
|
7
|
+
notifyChange({ origin, loading, error }: Amity.LiveCollectionNotifyParams): void;
|
|
8
|
+
startSubscription(): Amity.Unsubscriber[];
|
|
9
|
+
protected setup(): void;
|
|
10
|
+
protected persistModel(response: Amity.StreamPayload): void;
|
|
11
|
+
protected persistQueryStream({ response, direction, refresh, }: Amity.LiveCollectionPersistQueryStreamParams<'stream'>): void;
|
|
12
|
+
private applyFilter;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=GetStreamsLiveCollectionController.d.ts.map
|
package/dist/streamRepository/observers/getStreams/GetStreamsLiveCollectionController.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GetStreamsLiveCollectionController.d.ts","sourceRoot":"","sources":["../../../../src/streamRepository/observers/getStreams/GetStreamsLiveCollectionController.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AAW1F,OAAO,EAAE,wBAAwB,EAAE,MAAM,kEAAkE,CAAC;AAG5G,qBAAa,kCAAmC,SAAQ,wBAAwB,CAC9E,QAAQ,EACR,KAAK,CAAC,oBAAoB,EAC1B,KAAK,CAAC,MAAM,EACZ,wBAAwB,CACzB;IACC,OAAO,CAAC,qBAAqB,CAAkC;IAE/D,OAAO,CAAC,KAAK,CAA6B;gBAGxC,KAAK,EAAE,KAAK,CAAC,oBAAoB,EACjC,QAAQ,EAAE,KAAK,CAAC,sBAAsB,CAAC,KAAK,CAAC,MAAM,CAAC;IAsBtD,YAAY,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,CAAC,0BAA0B;IAuBzE,iBAAiB;IAUjB,SAAS,CAAC,KAAK;IAUf,SAAS,CAAC,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC,aAAa;IAIpD,SAAS,CAAC,kBAAkB,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,OAAO,GACR,EAAE,KAAK,CAAC,sCAAsC,CAAC,QAAQ,CAAC;IAIzD,OAAO,CAAC,WAAW,CAQjB;CACH"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PaginationController } from '~/core/liveCollection/PaginationController';
|
|
2
|
+
export declare class GetStreamsPageController extends PaginationController<'stream', Amity.StreamLiveCollection> {
|
|
3
|
+
getRequest(queryParams: Amity.StreamLiveCollection, token: string | undefined): Promise<{
|
|
4
|
+
paging: {
|
|
5
|
+
previous?: string | undefined;
|
|
6
|
+
next?: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
videoStreamings: Amity.InternalStream[];
|
|
9
|
+
videoStreamModerations: Amity.StreamModeration[];
|
|
10
|
+
users: Amity.InternalUser[];
|
|
11
|
+
files: Amity.File<"image">[];
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=GetStreamsPageController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GetStreamsPageController.d.ts","sourceRoot":"","sources":["../../../../src/streamRepository/observers/getStreams/GetStreamsPageController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAGlF,qBAAa,wBAAyB,SAAQ,oBAAoB,CAChE,QAAQ,EACR,KAAK,CAAC,oBAAoB,CAC3B;IACO,UAAU,CAAC,WAAW,EAAE,KAAK,CAAC,oBAAoB,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS;;;;;;;;;;CAepF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { QueryStreamController } from '~/core/liveCollection/QueryStreamController';
|
|
2
|
+
import { GetStreamsPageController } from '~/streamRepository/observers/getStreams/GetStreamsPageController';
|
|
3
|
+
export declare class GetStreamsQueryStreamController extends QueryStreamController<Amity.StreamPayload, Amity.StreamLiveCollection> {
|
|
4
|
+
private notifyChange;
|
|
5
|
+
private paginationController;
|
|
6
|
+
constructor(query: Amity.StreamLiveCollection, cacheKey: string[], notifyChange: (params: Amity.LiveCollectionNotifyParams) => void, paginationController: GetStreamsPageController);
|
|
7
|
+
saveToMainDB(response: Amity.StreamPayload): void;
|
|
8
|
+
appendToQueryStream(response: Amity.StreamPayload & Partial<Amity.Pagination>, direction: Amity.LiveCollectionPageDirection, refresh?: boolean): void;
|
|
9
|
+
reactor(action: string): (payload: Amity.InternalStream) => void;
|
|
10
|
+
subscribeRTE(createSubscriber: {
|
|
11
|
+
fn: (reactor: Amity.Listener<Amity.InternalStream>) => Amity.Unsubscriber;
|
|
12
|
+
action: string;
|
|
13
|
+
}[]): Amity.Unsubscriber[];
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=GetStreamsQueryStreamController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GetStreamsQueryStreamController.d.ts","sourceRoot":"","sources":["../../../../src/streamRepository/observers/getStreams/GetStreamsQueryStreamController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAGpF,OAAO,EAAE,wBAAwB,EAAE,MAAM,kEAAkE,CAAC;AAI5G,qBAAa,+BAAgC,SAAQ,qBAAqB,CACxE,KAAK,CAAC,aAAa,EACnB,KAAK,CAAC,oBAAoB,CAC3B;IACC,OAAO,CAAC,YAAY,CAAqD;IAEzE,OAAO,CAAC,oBAAoB,CAA2B;gBAGrD,KAAK,EAAE,KAAK,CAAC,oBAAoB,EACjC,QAAQ,EAAE,MAAM,EAAE,EAClB,YAAY,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,0BAA0B,KAAK,IAAI,EAChE,oBAAoB,EAAE,wBAAwB;IAQhD,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC,aAAa;IAS1C,mBAAmB,CACjB,QAAQ,EAAE,KAAK,CAAC,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,EACzD,SAAS,EAAE,KAAK,CAAC,2BAA2B,EAC5C,OAAO,UAAQ;IAsBjB,OAAO,CAAC,MAAM,EAAE,MAAM,aACH,MAAM,cAAc;IAYvC,YAAY,CACV,gBAAgB,EAAE;QAChB,EAAE,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,KAAK,CAAC,YAAY,CAAC;QAC1E,MAAM,EAAE,MAAM,CAAC;KAChB,EAAE;CAIN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getStreams.d.ts","sourceRoot":"","sources":["../../../../src/streamRepository/observers/getStreams/getStreams.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,UAAU,WACb,MAAM,oBAAoB,YACxB,MAAM,sBAAsB,CAAC,MAAM,MAAM,CAAC,WAC3C,MAAM,oBAAoB,eAuBpC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/streamRepository/observers/getStreams/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -3,6 +3,7 @@ export declare const LinkedObject: {
|
|
|
3
3
|
post: (post: Amity.InternalPost<any>) => Amity.Post<any>;
|
|
4
4
|
user: (user: Amity.InternalUser) => Amity.User;
|
|
5
5
|
category: (category: Amity.InternalCategory) => Amity.Category;
|
|
6
|
+
stream: (stream: Amity.InternalStream) => Amity.Stream;
|
|
6
7
|
story: (story: Amity.InternalStory) => Amity.Story;
|
|
7
8
|
storyTarget: (storyTarget: Amity.RawStoryTarget) => Amity.StoryTarget;
|
|
8
9
|
message: (message: Amity.InternalMessage<any>) => Amity.Message<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/linkedObject/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/linkedObject/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,YAAY;;;;;;;;;;;CAWxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamLinkedObject.d.ts","sourceRoot":"","sources":["../../../src/utils/linkedObject/streamLinkedObject.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,WAAY,MAAM,cAAc,KAAG,MAAM,MAQvE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amityco/ts-sdk-react-native",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.25.1",
|
|
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",
|
|
@@ -46,12 +46,14 @@
|
|
|
46
46
|
"@types/jest": "^27.5.1",
|
|
47
47
|
"@types/node": "^18.6.4",
|
|
48
48
|
"@types/object-hash": "^3.0.6",
|
|
49
|
+
"@types/react-native": "0.63.4",
|
|
49
50
|
"@types/socket.io-client": "^1.4.34",
|
|
50
51
|
"chalk": "^4.1.2",
|
|
51
52
|
"concurrently": "^6.1.0",
|
|
52
53
|
"form-data": "^4.0.0",
|
|
53
54
|
"jest": "^28.1.0",
|
|
54
55
|
"nock": "^13.3.0",
|
|
56
|
+
"react-native": "0.63.4",
|
|
55
57
|
"react-native-web": "^0.19.8",
|
|
56
58
|
"rimraf": "^3.0.2",
|
|
57
59
|
"rollup": "^2.77.2",
|
package/rollup.config.js
CHANGED
|
@@ -29,6 +29,10 @@ declare global {
|
|
|
29
29
|
'v3.video-streaming.didRecord': Amity.StreamPayload;
|
|
30
30
|
'v3.video-streaming.didStart': Amity.StreamPayload;
|
|
31
31
|
'v3.video-streaming.didStop': Amity.StreamPayload;
|
|
32
|
+
|
|
33
|
+
// Video Moderation
|
|
34
|
+
'v3.video-streaming.didFlag': Amity.StreamPayload;
|
|
35
|
+
'v3.video-streaming.didTerminate': Amity.StreamPayload;
|
|
32
36
|
};
|
|
33
37
|
|
|
34
38
|
type MqttEvents = {
|
|
@@ -210,7 +214,7 @@ declare global {
|
|
|
210
214
|
'local.story.reload': { referenceIds: Amity.Story['referenceId'][] };
|
|
211
215
|
|
|
212
216
|
'local.post.updated': Amity.PostPayload;
|
|
213
|
-
|
|
217
|
+
|
|
214
218
|
'local.comment.created': Amity.CommentPayload;
|
|
215
219
|
'local.comment.deleted': Amity.CommentPayload;
|
|
216
220
|
|
package/src/@types/core/model.ts
CHANGED
|
@@ -41,7 +41,8 @@ declare global {
|
|
|
41
41
|
reaction: Amity.Reaction;
|
|
42
42
|
reactor: Amity.InternalReactor;
|
|
43
43
|
|
|
44
|
-
stream: Amity.
|
|
44
|
+
stream: Amity.InternalStream;
|
|
45
|
+
streamModeration: Amity.StreamModeration;
|
|
45
46
|
|
|
46
47
|
follow: Amity.FollowStatus;
|
|
47
48
|
followInfo: Amity.FollowInfo;
|
|
@@ -93,7 +94,8 @@ declare global {
|
|
|
93
94
|
reaction: Pick<Amity.Reaction, 'referenceType' | 'referenceId'>;
|
|
94
95
|
reactor: Pick<Amity.InternalReactor, 'reactionId'>;
|
|
95
96
|
|
|
96
|
-
stream: Pick<Amity.
|
|
97
|
+
stream: Pick<Amity.InternalStream, 'streamId'>;
|
|
98
|
+
streamModeration: Pick<Amity.StreamModeration, 'streamId'>;
|
|
97
99
|
|
|
98
100
|
follow: Pick<Amity.FollowStatus, 'from' | 'to'>;
|
|
99
101
|
followInfo: Pick<Amity.FollowInfo, 'userId' | 'status'>;
|
|
@@ -239,7 +239,8 @@ declare global {
|
|
|
239
239
|
};
|
|
240
240
|
|
|
241
241
|
type StreamPayload = {
|
|
242
|
-
videoStreamings: Amity.
|
|
242
|
+
videoStreamings: Amity.InternalStream[];
|
|
243
|
+
videoStreamModerations: Amity.StreamModeration[];
|
|
243
244
|
users: Amity.InternalUser[];
|
|
244
245
|
files: Amity.File<'image'>[];
|
|
245
246
|
};
|
|
@@ -44,7 +44,7 @@ declare global {
|
|
|
44
44
|
stopTime: number;
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
type
|
|
47
|
+
type InternalStream = {
|
|
48
48
|
streamId: string;
|
|
49
49
|
title: string;
|
|
50
50
|
thumbnailFileId?: Amity.File<'image'>['fileId'];
|
|
@@ -65,20 +65,40 @@ declare global {
|
|
|
65
65
|
Amity.Timestamps &
|
|
66
66
|
Amity.SoftDelete;
|
|
67
67
|
|
|
68
|
+
type StreamLinkedObject = {
|
|
69
|
+
moderation?: Amity.StreamModeration;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
type Stream = Amity.InternalStream & Amity.StreamLinkedObject;
|
|
73
|
+
|
|
68
74
|
type QueryStreams = {
|
|
69
75
|
isLive?: boolean;
|
|
70
76
|
statuses?: Amity.StreamStatus[];
|
|
71
77
|
userPublicIds?: Amity.InternalUser['userId'][];
|
|
72
78
|
sortBy?: 'lastCreated' | 'firstCreated';
|
|
73
|
-
isDeleted?: Amity.
|
|
79
|
+
isDeleted?: Amity.InternalStream['isDeleted'];
|
|
74
80
|
page?: string;
|
|
75
81
|
limit?: number;
|
|
76
82
|
};
|
|
77
83
|
|
|
84
|
+
type StreamModerationLabel = {
|
|
85
|
+
categoryId: string;
|
|
86
|
+
detectedAt: Amity.timestamp;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
type StreamModeration = {
|
|
90
|
+
moderationId: string;
|
|
91
|
+
streamId: Amity.InternalStream['streamId'];
|
|
92
|
+
flagLabels: Amity.StreamModerationLabel[];
|
|
93
|
+
terminateLabels: Amity.StreamModerationLabel[];
|
|
94
|
+
createdAt: Amity.timestamp;
|
|
95
|
+
updatedAt: Amity.timestamp;
|
|
96
|
+
};
|
|
97
|
+
|
|
78
98
|
type StreamLiveCollection = Amity.LiveCollectionParams<Omit<QueryStreams, 'page'>>;
|
|
79
99
|
|
|
80
100
|
type StreamLiveCollectionCache = Amity.LiveCollectionCache<
|
|
81
|
-
Amity.
|
|
101
|
+
Amity.InternalStream['streamId'],
|
|
82
102
|
Pick<QueryStreams, 'page'>
|
|
83
103
|
>;
|
|
84
104
|
|
package/src/client/api/index.ts
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
import { getActiveClient } from './activeClient';
|
|
3
|
+
import { getDeviceId } from '~/core/device';
|
|
4
|
+
import { ASCApiError, ASCInvalidParameterError } from '~/core/errors';
|
|
5
|
+
|
|
6
|
+
export const registerPushNotification = async (deviceToken: string): Promise<boolean> => {
|
|
7
|
+
const client = getActiveClient();
|
|
8
|
+
|
|
9
|
+
let platform: 'ios' | 'android';
|
|
10
|
+
|
|
11
|
+
if (Platform.OS === 'ios' || Platform.OS === 'android') {
|
|
12
|
+
platform = Platform.OS;
|
|
13
|
+
} else {
|
|
14
|
+
throw new ASCInvalidParameterError('Unsupported platform');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const deviceId = getDeviceId();
|
|
18
|
+
|
|
19
|
+
const {
|
|
20
|
+
data: { status, error },
|
|
21
|
+
} = await client.http.post<{ status: 'success' | 'error'; error?: string }>(
|
|
22
|
+
'/v1/notification',
|
|
23
|
+
{
|
|
24
|
+
userId: client.userId,
|
|
25
|
+
deviceId,
|
|
26
|
+
platform,
|
|
27
|
+
token: deviceToken,
|
|
28
|
+
},
|
|
29
|
+
{ headers: { 'X-API-Key': client.apiKey } },
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
if (error) {
|
|
33
|
+
throw new ASCApiError(error, Amity.ServerError.BUSINESS_ERROR, Amity.ErrorLevel.ERROR);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return status === 'success';
|
|
37
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { getDeviceId } from '~/core/device';
|
|
2
|
+
import { getActiveClient } from './activeClient';
|
|
3
|
+
import { ASCApiError } from '~/core/errors';
|
|
4
|
+
|
|
5
|
+
export const unregisterPushNotification = async (): Promise<boolean> => {
|
|
6
|
+
const client = getActiveClient();
|
|
7
|
+
const deviceId = getDeviceId();
|
|
8
|
+
|
|
9
|
+
const {
|
|
10
|
+
data: { status, error },
|
|
11
|
+
} = await client.http.delete<{ status: 'success' | 'error'; error?: string }>(
|
|
12
|
+
'/v1/notification',
|
|
13
|
+
{
|
|
14
|
+
data: {
|
|
15
|
+
deviceId,
|
|
16
|
+
},
|
|
17
|
+
headers: { 'X-API-Key': client.apiKey },
|
|
18
|
+
},
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
if (error) {
|
|
22
|
+
throw new ASCApiError(error, Amity.ServerError.BUSINESS_ERROR, Amity.ErrorLevel.ERROR);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return status === 'success';
|
|
26
|
+
};
|