@amityco/ts-sdk 0.0.1-beta.12 → 0.0.1-beta.13
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/client.d.ts +1 -1
- package/dist/@types/domains/client.d.ts.map +1 -1
- package/dist/@types/domains/comment.d.ts +2 -1
- package/dist/@types/domains/comment.d.ts.map +1 -1
- package/dist/@types/domains/file.d.ts +2 -2
- package/dist/@types/domains/file.d.ts.map +1 -1
- package/dist/@types/domains/partials.d.ts +10 -0
- package/dist/@types/domains/partials.d.ts.map +1 -1
- package/dist/@types/domains/post.d.ts +3 -2
- package/dist/@types/domains/post.d.ts.map +1 -1
- package/dist/client/api/disconnectClient.d.ts.map +1 -1
- package/dist/comment/api/createComment.d.ts +1 -1
- package/dist/comment/api/createComment.d.ts.map +1 -1
- package/dist/comment/api/updateComment.d.ts +1 -1
- package/dist/comment/api/updateComment.d.ts.map +1 -1
- package/dist/index.cjs.js +11 -11
- package/dist/index.esm.js +11 -11
- package/dist/index.umd.js +3 -3
- package/dist/post/api/createPost.d.ts +7 -3
- package/dist/post/api/createPost.d.ts.map +1 -1
- package/dist/post/api/updatePost.d.ts +1 -1
- package/dist/post/api/updatePost.d.ts.map +1 -1
- package/package.json +1 -1
- package/rollup.config.js +3 -0
- package/src/@types/domains/client.ts +1 -1
- package/src/@types/domains/comment.ts +3 -0
- package/src/@types/domains/file.ts +2 -1
- package/src/@types/domains/partials.ts +8 -0
- package/src/@types/domains/post.ts +4 -1
- package/src/client/api/connectClient.ts +1 -1
- package/src/client/api/disconnectClient.ts +0 -1
- package/src/comment/api/createComment.ts +1 -2
- package/src/comment/api/updateComment.ts +1 -1
- package/src/core/debug.ts +1 -1
- package/src/core/subscription.ts +4 -4
- package/src/post/api/createPost.ts +6 -4
- package/src/post/api/updatePost.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/@types/domains/client.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAE9B,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK,CAAC;QACd,KAAK,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAA;QAErD,KAAK,MAAM,GAAG;YACZ,OAAO,EAAE,MAAM,CAAA;YAEf,GAAG,EAAE,MAAM,CAAA;YACX,IAAI,EAAE,aAAa,CAAA;YACnB,IAAI,EAAE,KAAK,CAAC,UAAU,CAAA;YACtB,EAAE,EAAE,cAAc,CAAC,MAAM,CAAA;YACzB,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;YAE9B,KAAK,CAAC,EAAE,KAAK,CAAC,KAAK,CAAA;YAEnB,MAAM,CAAC,EAAE,MAAM,CAAA;YACf,MAAM,CAAC,EAAE,MAAM,CAAA;YACf,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/@types/domains/client.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAE9B,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK,CAAC;QACd,KAAK,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAA;QAErD,KAAK,MAAM,GAAG;YACZ,OAAO,EAAE,MAAM,CAAA;YAEf,GAAG,EAAE,MAAM,CAAA;YACX,IAAI,EAAE,aAAa,CAAA;YACnB,IAAI,EAAE,KAAK,CAAC,UAAU,CAAA;YACtB,EAAE,EAAE,cAAc,CAAC,MAAM,CAAA;YACzB,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;YAE9B,KAAK,CAAC,EAAE,KAAK,CAAC,KAAK,CAAA;YAEnB,MAAM,CAAC,EAAE,MAAM,CAAA;YACf,MAAM,CAAC,EAAE,MAAM,CAAA;YACf,eAAe,CAAC,EAAE,MAAM,CAAA;YACxB,WAAW,CAAC,EAAE,MAAM,CAAA;YAEpB,GAAG,EAAE,MAAM,IAAI,CAAA;SAChB,CAAA;QAED,KAAK,MAAM,GAAG;YACZ,QAAQ,EAAE,MAAM,CAAA;YAChB,UAAU,EAAE;gBACV,OAAO,EAAE,MAAM,CAAA;gBACf,IAAI,EAAE,MAAM,GAAG,KAAK,CAAA;gBACpB,KAAK,CAAC,EAAE,MAAM,CAAA;aACf,CAAA;SACF,CAAA;QAED,KAAK,MAAM,GAAG;YACZ,WAAW,EAAE,MAAM,CAAA;YACnB,YAAY,EAAE,MAAM,CAAA;SACrB,CAAA;KACF;CACF"}
|
|
@@ -3,6 +3,7 @@ declare global {
|
|
|
3
3
|
namespace Amity {
|
|
4
4
|
type CommentContentType = ('text');
|
|
5
5
|
type CommentReferenceType = ('content' | 'post');
|
|
6
|
+
type CommentMentionType = keyof MentionTypes;
|
|
6
7
|
type Comment<T extends CommentContentType = any> = {
|
|
7
8
|
commentId: string;
|
|
8
9
|
userId: string;
|
|
@@ -11,7 +12,7 @@ declare global {
|
|
|
11
12
|
childrenNumber: number;
|
|
12
13
|
children: Comment['commentId'][];
|
|
13
14
|
segmentNumber: number;
|
|
14
|
-
} & Amity.Relationship<CommentReferenceType> & Amity.Content<T> & Amity.Metadata & Amity.Flaggable & Amity.Reactable & Amity.Timestamps & Amity.SoftDelete & Amity.Subscribable
|
|
15
|
+
} & Amity.Relationship<CommentReferenceType> & Amity.Content<T> & Amity.Metadata & Amity.Flaggable & Amity.Reactable & Amity.Timestamps & Amity.SoftDelete & Amity.Subscribable & Amity.Mentionable<CommentMentionType>;
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
//# sourceMappingURL=comment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comment.d.ts","sourceRoot":"","sources":["../../../src/@types/domains/comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAA;AAET,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK,CAAC;QACd,KAAK,kBAAkB,GAAG,CAAC,MAAM,CAAC,CAAA;QAClC,KAAK,oBAAoB,GAAG,CAAC,SAAS,GAAG,MAAM,CAAC,CAAA;QAEhD,KAAK,OAAO,CAAC,CAAC,SAAS,kBAAkB,GAAG,GAAG,IAAI;YACjD,SAAS,EAAE,MAAM,CAAA;YACjB,MAAM,EAAE,MAAM,CAAA;YACd,QAAQ,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;YAC/B,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;YAC5B,cAAc,EAAE,MAAM,CAAA;YACtB,QAAQ,EAAE,OAAO,CAAC,WAAW,CAAC,EAAE,CAAA;YAChC,aAAa,EAAE,MAAM,CAAA;SACtB,GACC,KAAK,CAAC,YAAY,CAAC,oBAAoB,CAAC,GACxC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAChB,KAAK,CAAC,QAAQ,GACd,KAAK,CAAC,SAAS,GACf,KAAK,CAAC,SAAS,GACf,KAAK,CAAC,UAAU,GAChB,KAAK,CAAC,UAAU,GAChB,KAAK,CAAC,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"comment.d.ts","sourceRoot":"","sources":["../../../src/@types/domains/comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAA;AAET,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK,CAAC;QACd,KAAK,kBAAkB,GAAG,CAAC,MAAM,CAAC,CAAA;QAClC,KAAK,oBAAoB,GAAG,CAAC,SAAS,GAAG,MAAM,CAAC,CAAA;QAEhD,KAAK,kBAAkB,GAAG,MAAM,YAAY,CAAA;QAE5C,KAAK,OAAO,CAAC,CAAC,SAAS,kBAAkB,GAAG,GAAG,IAAI;YACjD,SAAS,EAAE,MAAM,CAAA;YACjB,MAAM,EAAE,MAAM,CAAA;YACd,QAAQ,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;YAC/B,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;YAC5B,cAAc,EAAE,MAAM,CAAA;YACtB,QAAQ,EAAE,OAAO,CAAC,WAAW,CAAC,EAAE,CAAA;YAChC,aAAa,EAAE,MAAM,CAAA;SACtB,GACC,KAAK,CAAC,YAAY,CAAC,oBAAoB,CAAC,GACxC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAChB,KAAK,CAAC,QAAQ,GACd,KAAK,CAAC,SAAS,GACf,KAAK,CAAC,SAAS,GACf,KAAK,CAAC,UAAU,GAChB,KAAK,CAAC,UAAU,GAChB,KAAK,CAAC,YAAY,GAClB,KAAK,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAA;KACxC;CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export {};
|
|
2
2
|
declare global {
|
|
3
3
|
namespace Amity {
|
|
4
|
-
type FileType = 'file' | 'image';
|
|
4
|
+
type FileType = 'file' | 'image' | 'video';
|
|
5
5
|
type FileMetadata = {};
|
|
6
6
|
type ImageMetadata = {
|
|
7
7
|
exif: Object;
|
|
@@ -11,7 +11,7 @@ declare global {
|
|
|
11
11
|
isFull: boolean;
|
|
12
12
|
};
|
|
13
13
|
type VideoMetadata = {};
|
|
14
|
-
type MetadataFor<T extends FileType> = (T extends 'file' ? FileMetadata : T extends 'image' ? ImageMetadata : never);
|
|
14
|
+
type MetadataFor<T extends FileType> = (T extends 'file' ? FileMetadata : T extends 'image' ? ImageMetadata : T extends 'video' ? VideoMetadata : never);
|
|
15
15
|
type File<T extends FileType = any> = {
|
|
16
16
|
fileId: string;
|
|
17
17
|
type: T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../src/@types/domains/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAA;AAET,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK,CAAC;QACd,KAAK,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../src/@types/domains/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAA;AAET,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK,CAAC;QACd,KAAK,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAA;QAE1C,KAAK,YAAY,GAAG,EAAE,CAAA;QAEtB,KAAK,aAAa,GAAG;YACnB,IAAI,EAAE,MAAM,CAAA;YACZ,GAAG,EAAE,MAAM,CAAA;YACX,KAAK,EAAE,MAAM,CAAA;YACb,MAAM,EAAE,MAAM,CAAA;YACd,MAAM,EAAE,OAAO,CAAA;SAChB,CAAA;QAED,KAAK,aAAa,GAAG,EAAE,CAAA;QAEvB,KAAK,WAAW,CAAC,CAAC,SAAS,QAAQ,IAAI,CACrC,CAAC,SAAS,MAAM,GAAG,YAAY,GAC/B,CAAC,SAAS,OAAO,GAAG,aAAa,GACjC,CAAC,SAAS,OAAO,GAAG,aAAa,GACjC,KAAK,CACN,CAAA;QAED,KAAK,IAAI,CAAC,CAAC,SAAS,QAAQ,GAAG,GAAG,IAAI;YACpC,MAAM,EAAE,MAAM,CAAA;YACd,IAAI,EAAE,CAAC,CAAA;YACP,OAAO,EAAE,MAAM,CAAA;YACf,UAAU,EAAE;gBACV,IAAI,EAAE,MAAM,CAAA;gBACZ,SAAS,EAAE,MAAM,CAAA;gBACjB,IAAI,EAAE,MAAM,CAAA;gBACZ,QAAQ,EAAE,MAAM,CAAA;gBAChB,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,CAAA;aACzB,CAAA;SACF,GACC,KAAK,CAAC,UAAU,GAChB,KAAK,CAAC,UAAU,CAAA;KACnB;CACF"}
|
|
@@ -40,6 +40,16 @@ declare global {
|
|
|
40
40
|
type Subscribable = {
|
|
41
41
|
path: string;
|
|
42
42
|
};
|
|
43
|
+
type MentionTypes = {
|
|
44
|
+
user: {
|
|
45
|
+
userIds: Amity.User['userId'][];
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
type Mentionable<T extends keyof MentionTypes> = {
|
|
49
|
+
mentionees?: {
|
|
50
|
+
type: T & MentionTypes;
|
|
51
|
+
}[];
|
|
52
|
+
};
|
|
43
53
|
}
|
|
44
54
|
}
|
|
45
55
|
//# sourceMappingURL=partials.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partials.d.ts","sourceRoot":"","sources":["../../../src/@types/domains/partials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAA;AAET,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK,CAAC;QACd,KAAK,SAAS,GAAG,MAAM,CAAA;QAEvB,KAAK,SAAS,GAAG;YACf,SAAS,EAAE,SAAS,CAAA;SACrB,CAAA;QAED,KAAK,SAAS,GAAG;YACf,SAAS,CAAC,EAAE,SAAS,CAAA;SACtB,CAAA;QAED,KAAK,SAAS,GAAG;YACf,SAAS,CAAC,EAAE,SAAS,CAAA;SACtB,CAAA;QAED,KAAK,UAAU,GAAG,SAAS,GAAG,SAAS,CAAA;QAEvC,KAAK,UAAU,GAAG,SAAS,GAAG;YAC5B,SAAS,CAAC,EAAE,OAAO,CAAA;SACpB,CAAA;QAED,KAAK,QAAQ,GAAG;YACd,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;SAC/B,CAAA;QAED,KAAK,YAAY,CAAC,CAAC,SAAS,MAAM,IAAI;YACpC,WAAW,EAAE,MAAM,CAAA;YACnB,aAAa,EAAE,CAAC,CAAA;SACjB,CAAA;QAED,KAAK,SAAS,GAAG;YACf,SAAS,EAAE,MAAM,CAAA;YACjB,QAAQ,EAAE;gBACR,IAAI,EAAE,MAAM,CAAA;gBACZ,MAAM,EAAE,MAAM,CAAA;gBACd,IAAI,EAAE,MAAM,CAAA;aACb,GAAG,IAAI,CAAA;SACT,CAAA;QAED,KAAK,QAAQ,GAAG;YACd,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;SAChB,CAAA;QAED,KAAK,UAAU,GAAG;YACd,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAA;YAClC,WAAW,EAAE,KAAK,CAAC,UAAU,EAAE,CAAA;SAClC,CAAA;QAED,KAAK,YAAY,GAAG;YAClB,IAAI,EAAE,MAAM,CAAA;SACb,CAAA;KACF;CACF"}
|
|
1
|
+
{"version":3,"file":"partials.d.ts","sourceRoot":"","sources":["../../../src/@types/domains/partials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAA;AAET,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK,CAAC;QACd,KAAK,SAAS,GAAG,MAAM,CAAA;QAEvB,KAAK,SAAS,GAAG;YACf,SAAS,EAAE,SAAS,CAAA;SACrB,CAAA;QAED,KAAK,SAAS,GAAG;YACf,SAAS,CAAC,EAAE,SAAS,CAAA;SACtB,CAAA;QAED,KAAK,SAAS,GAAG;YACf,SAAS,CAAC,EAAE,SAAS,CAAA;SACtB,CAAA;QAED,KAAK,UAAU,GAAG,SAAS,GAAG,SAAS,CAAA;QAEvC,KAAK,UAAU,GAAG,SAAS,GAAG;YAC5B,SAAS,CAAC,EAAE,OAAO,CAAA;SACpB,CAAA;QAED,KAAK,QAAQ,GAAG;YACd,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;SAC/B,CAAA;QAED,KAAK,YAAY,CAAC,CAAC,SAAS,MAAM,IAAI;YACpC,WAAW,EAAE,MAAM,CAAA;YACnB,aAAa,EAAE,CAAC,CAAA;SACjB,CAAA;QAED,KAAK,SAAS,GAAG;YACf,SAAS,EAAE,MAAM,CAAA;YACjB,QAAQ,EAAE;gBACR,IAAI,EAAE,MAAM,CAAA;gBACZ,MAAM,EAAE,MAAM,CAAA;gBACd,IAAI,EAAE,MAAM,CAAA;aACb,GAAG,IAAI,CAAA;SACT,CAAA;QAED,KAAK,QAAQ,GAAG;YACd,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;SAChB,CAAA;QAED,KAAK,UAAU,GAAG;YACd,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAA;YAClC,WAAW,EAAE,KAAK,CAAC,UAAU,EAAE,CAAA;SAClC,CAAA;QAED,KAAK,YAAY,GAAG;YAClB,IAAI,EAAE,MAAM,CAAA;SACb,CAAA;QAED,KAAK,YAAY,GAAG;YAClB,IAAI,EAAE;gBAAE,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAA;aAAE,CAAA;SAC1C,CAAA;QAED,KAAK,WAAW,CAAC,CAAC,SAAS,MAAM,YAAY,IAAI;YAC/C,UAAU,CAAC,EAAE;gBAAC,IAAI,EAAE,CAAC,GAAG,YAAY,CAAA;aAAC,EAAE,CAAA;SACxC,CAAA;KACF;CACF"}
|
|
@@ -2,7 +2,8 @@ export {};
|
|
|
2
2
|
declare global {
|
|
3
3
|
namespace Amity {
|
|
4
4
|
type PostTargetType = Amity.FeedType | 'content';
|
|
5
|
-
type PostContentType = ('text' | 'image' | 'file');
|
|
5
|
+
type PostContentType = ('text' | 'image' | 'file' | 'video');
|
|
6
|
+
type PostMentionType = keyof MentionTypes;
|
|
6
7
|
type Post<T extends PostContentType = any> = {
|
|
7
8
|
postId: string;
|
|
8
9
|
postedUserId: User['userId'];
|
|
@@ -16,7 +17,7 @@ declare global {
|
|
|
16
17
|
hasFlaggedChildren: false;
|
|
17
18
|
hasFlaggedComment: false;
|
|
18
19
|
editedAt: timestamp;
|
|
19
|
-
} & Amity.Content<T, 'dataType'> & Amity.Metadata & Amity.Flaggable & Amity.Reactable & Amity.Timestamps & Amity.SoftDelete & Amity.Subscribable
|
|
20
|
+
} & Amity.Content<T, 'dataType'> & Amity.Metadata & Amity.Flaggable & Amity.Reactable & Amity.Timestamps & Amity.SoftDelete & Amity.Subscribable & Amity.Mentionable<PostMentionType>;
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
//# sourceMappingURL=post.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../../src/@types/domains/post.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAA;AAET,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK,CAAC;QAEd,KAAK,cAAc,GAAG,KAAK,CAAC,QAAQ,GAAG,SAAS,CAAA;QAEhD,KAAK,eAAe,GAAG,CAAC,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../../src/@types/domains/post.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAA;AAET,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK,CAAC;QAEd,KAAK,cAAc,GAAG,KAAK,CAAC,QAAQ,GAAG,SAAS,CAAA;QAEhD,KAAK,eAAe,GAAG,CAAC,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAA;QAE5D,KAAK,eAAe,GAAG,MAAM,YAAY,CAAA;QAEzC,KAAK,IAAI,CAAC,CAAC,SAAS,eAAe,GAAG,GAAG,IAAI;YAC3C,MAAM,EAAE,MAAM,CAAA;YACd,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;YAC5B,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;YACxB,UAAU,EAAE,cAAc,CAAA;YAC1B,QAAQ,EAAE,MAAM,CAAA;YAChB,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;YACtB,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAA;YAChC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAA;YACtC,aAAa,EAAE,MAAM,CAAA;YACrB,kBAAkB,EAAE,KAAK,CAAA;YACzB,iBAAiB,EAAE,KAAK,CAAA;YACxB,QAAQ,EAAE,SAAS,CAAC;SACrB,GACC,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,UAAU,CAAC,GAC5B,KAAK,CAAC,QAAQ,GACd,KAAK,CAAC,SAAS,GACf,KAAK,CAAC,SAAS,GACf,KAAK,CAAC,UAAU,GAChB,KAAK,CAAC,UAAU,GAChB,KAAK,CAAC,YAAY,GAClB,KAAK,CAAC,WAAW,CAAC,eAAe,CAAC,CAAA;KACrC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disconnectClient.d.ts","sourceRoot":"","sources":["../../../src/client/api/disconnectClient.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,QAAa,QAAQ,OAAO,
|
|
1
|
+
{"version":3,"file":"disconnectClient.d.ts","sourceRoot":"","sources":["../../../src/client/api/disconnectClient.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,QAAa,QAAQ,OAAO,CAkBxD,CAAA"}
|
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
* @category Comment API
|
|
13
13
|
* @async
|
|
14
14
|
*/
|
|
15
|
-
export declare const createComment: <T extends "text">(bundle: Pick<Amity.Comment<T>, "referenceType" | "referenceId" | "parentId" | "data" | "metadata">) => Promise<Amity.Cached<Amity.Comment>>;
|
|
15
|
+
export declare const createComment: <T extends "text">(bundle: Pick<Amity.Comment<T>, "referenceType" | "referenceId" | "parentId" | "data" | "metadata" | "mentionees">) => Promise<Amity.Cached<Amity.Comment>>;
|
|
16
16
|
//# sourceMappingURL=createComment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createComment.d.ts","sourceRoot":"","sources":["../../../src/comment/api/createComment.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"createComment.d.ts","sourceRoot":"","sources":["../../../src/comment/api/createComment.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,aAAa,2IAEvB,QAAQ,MAAM,MAAM,CAAC,aAAa,CAAC,CAqBrC,CAAA"}
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
* @category Comment API
|
|
16
16
|
* @async
|
|
17
17
|
*/
|
|
18
|
-
export declare const updateComment: (commentId: Amity.Comment['commentId'], patch: Patch<Amity.Comment, 'data' | 'metadata'>) => Promise<Amity.Cached<Amity.Comment>>;
|
|
18
|
+
export declare const updateComment: (commentId: Amity.Comment['commentId'], patch: Patch<Amity.Comment, 'data' | 'metadata' | 'mentionees'>) => Promise<Amity.Cached<Amity.Comment>>;
|
|
19
19
|
//# sourceMappingURL=updateComment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateComment.d.ts","sourceRoot":"","sources":["../../../src/comment/api/updateComment.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,aAAa,cACb,aAAa,CAAC,WAAW,CAAC,SAC9B,MAAM,aAAa,EAAE,MAAM,GAAG,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"updateComment.d.ts","sourceRoot":"","sources":["../../../src/comment/api/updateComment.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,aAAa,cACb,aAAa,CAAC,WAAW,CAAC,SAC9B,MAAM,aAAa,EAAE,MAAM,GAAG,UAAU,GAAG,YAAY,CAAC,KAC9D,QAAQ,MAAM,MAAM,CAAC,aAAa,CAAC,CAkBrC,CAAA"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -21,7 +21,7 @@ var AsyncStorage__default = /*#__PURE__*/_interopDefaultLegacy(AsyncStorage);
|
|
|
21
21
|
|
|
22
22
|
var _a;
|
|
23
23
|
// used in createClient
|
|
24
|
-
const VERSION$1 = (_a = 'v0.0.1-beta.
|
|
24
|
+
const VERSION$1 = (_a = 'v0.0.1-beta.13-cjs') !== null && _a !== void 0 ? _a : '__dev__';
|
|
25
25
|
|
|
26
26
|
// @ts-ignore
|
|
27
27
|
/**
|
|
@@ -512,8 +512,9 @@ const setActiveClient = (client) => {
|
|
|
512
512
|
* @hidden
|
|
513
513
|
*/
|
|
514
514
|
const createLogger = (session) => {
|
|
515
|
+
var _a;
|
|
515
516
|
const active = (`${session === null || session === void 0 ? void 0 : session.trim()}`.length > 0
|
|
516
|
-
&& process.env.NODE_ENV !== 'production');
|
|
517
|
+
&& ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.NODE_ENV) !== 'production');
|
|
517
518
|
const logger = debug__default['default'](session);
|
|
518
519
|
const print = (topic, ...args) => {
|
|
519
520
|
active && logger(topic, args);
|
|
@@ -14904,7 +14905,6 @@ const disconnectClient = async () => {
|
|
|
14904
14905
|
client.ws.removeAllListeners();
|
|
14905
14906
|
client.mqtt.removeAllListeners();
|
|
14906
14907
|
client.userId = undefined;
|
|
14907
|
-
client.user = undefined;
|
|
14908
14908
|
client.accessToken = undefined;
|
|
14909
14909
|
return !client.ws.connected;
|
|
14910
14910
|
};
|
|
@@ -15089,7 +15089,7 @@ const connectClient = async (params) => {
|
|
|
15089
15089
|
unsubscribe();
|
|
15090
15090
|
});
|
|
15091
15091
|
client.userId = params.userId;
|
|
15092
|
-
client.
|
|
15092
|
+
client._internalUserId = users[0]._id;
|
|
15093
15093
|
client.accessToken = accessToken;
|
|
15094
15094
|
return client.ws.connected;
|
|
15095
15095
|
};
|
|
@@ -15151,11 +15151,11 @@ const getCommentTopic = ({ path }) => {
|
|
|
15151
15151
|
let mqttAccessToken;
|
|
15152
15152
|
let mqttUserId;
|
|
15153
15153
|
function subscribeTopic(topic, callback) {
|
|
15154
|
-
const { mqtt, emitter, accessToken,
|
|
15155
|
-
if (mqttAccessToken !== accessToken || mqttUserId !==
|
|
15154
|
+
const { mqtt, emitter, accessToken, _internalUserId } = getActiveClient();
|
|
15155
|
+
if (mqttAccessToken !== accessToken || mqttUserId !== _internalUserId) {
|
|
15156
15156
|
mqttAccessToken = accessToken;
|
|
15157
|
-
mqttUserId =
|
|
15158
|
-
mqtt.connect({ accessToken:
|
|
15157
|
+
mqttUserId = _internalUserId;
|
|
15158
|
+
mqtt.connect({ accessToken: mqttAccessToken, userId: mqttUserId });
|
|
15159
15159
|
proxyMqttEvents(mqtt, emitter);
|
|
15160
15160
|
}
|
|
15161
15161
|
return mqtt.subscribe(topic, callback);
|
|
@@ -16855,9 +16855,9 @@ const createPost = async (bundle) => {
|
|
|
16855
16855
|
const client = getActiveClient();
|
|
16856
16856
|
client.log('post/createPost', bundle);
|
|
16857
16857
|
// API-FIX: backend rejects that we pass the dataType manually T_T
|
|
16858
|
-
if (!bundle.dataType || ['text', 'image', 'file'].includes(bundle.dataType))
|
|
16858
|
+
if (!bundle.dataType || ['text', 'image', 'file', 'video'].includes(bundle.dataType))
|
|
16859
16859
|
delete bundle.dataType;
|
|
16860
|
-
const { data } = await client.http.post('/api/
|
|
16860
|
+
const { data } = await client.http.post('/api/v4/posts', bundle);
|
|
16861
16861
|
const cachedAt = client.cache && Date.now();
|
|
16862
16862
|
if (client.cache)
|
|
16863
16863
|
ingestInCache(data, { cachedAt });
|
|
@@ -16889,7 +16889,7 @@ const createPost = async (bundle) => {
|
|
|
16889
16889
|
const updatePost = async (postId, patch) => {
|
|
16890
16890
|
const client = getActiveClient();
|
|
16891
16891
|
client.log('user/updatePost', patch);
|
|
16892
|
-
const { data } = await client.http.put(`/api/
|
|
16892
|
+
const { data } = await client.http.put(`/api/v4/posts/${encodeURIComponent(postId)}`, patch);
|
|
16893
16893
|
const cachedAt = client.cache && Date.now();
|
|
16894
16894
|
if (client.cache)
|
|
16895
16895
|
ingestInCache(data, { cachedAt });
|
package/dist/index.esm.js
CHANGED
|
@@ -8,7 +8,7 @@ import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
|
8
8
|
|
|
9
9
|
var _a;
|
|
10
10
|
// used in createClient
|
|
11
|
-
const VERSION$1 = (_a = 'v0.0.1-beta.
|
|
11
|
+
const VERSION$1 = (_a = 'v0.0.1-beta.13-esm') !== null && _a !== void 0 ? _a : '__dev__';
|
|
12
12
|
|
|
13
13
|
// @ts-ignore
|
|
14
14
|
/**
|
|
@@ -499,8 +499,9 @@ const setActiveClient = (client) => {
|
|
|
499
499
|
* @hidden
|
|
500
500
|
*/
|
|
501
501
|
const createLogger = (session) => {
|
|
502
|
+
var _a;
|
|
502
503
|
const active = (`${session === null || session === void 0 ? void 0 : session.trim()}`.length > 0
|
|
503
|
-
&& process.env.NODE_ENV !== 'production');
|
|
504
|
+
&& ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.NODE_ENV) !== 'production');
|
|
504
505
|
const logger = debug(session);
|
|
505
506
|
const print = (topic, ...args) => {
|
|
506
507
|
active && logger(topic, args);
|
|
@@ -14891,7 +14892,6 @@ const disconnectClient = async () => {
|
|
|
14891
14892
|
client.ws.removeAllListeners();
|
|
14892
14893
|
client.mqtt.removeAllListeners();
|
|
14893
14894
|
client.userId = undefined;
|
|
14894
|
-
client.user = undefined;
|
|
14895
14895
|
client.accessToken = undefined;
|
|
14896
14896
|
return !client.ws.connected;
|
|
14897
14897
|
};
|
|
@@ -15076,7 +15076,7 @@ const connectClient = async (params) => {
|
|
|
15076
15076
|
unsubscribe();
|
|
15077
15077
|
});
|
|
15078
15078
|
client.userId = params.userId;
|
|
15079
|
-
client.
|
|
15079
|
+
client._internalUserId = users[0]._id;
|
|
15080
15080
|
client.accessToken = accessToken;
|
|
15081
15081
|
return client.ws.connected;
|
|
15082
15082
|
};
|
|
@@ -15138,11 +15138,11 @@ const getCommentTopic = ({ path }) => {
|
|
|
15138
15138
|
let mqttAccessToken;
|
|
15139
15139
|
let mqttUserId;
|
|
15140
15140
|
function subscribeTopic(topic, callback) {
|
|
15141
|
-
const { mqtt, emitter, accessToken,
|
|
15142
|
-
if (mqttAccessToken !== accessToken || mqttUserId !==
|
|
15141
|
+
const { mqtt, emitter, accessToken, _internalUserId } = getActiveClient();
|
|
15142
|
+
if (mqttAccessToken !== accessToken || mqttUserId !== _internalUserId) {
|
|
15143
15143
|
mqttAccessToken = accessToken;
|
|
15144
|
-
mqttUserId =
|
|
15145
|
-
mqtt.connect({ accessToken:
|
|
15144
|
+
mqttUserId = _internalUserId;
|
|
15145
|
+
mqtt.connect({ accessToken: mqttAccessToken, userId: mqttUserId });
|
|
15146
15146
|
proxyMqttEvents(mqtt, emitter);
|
|
15147
15147
|
}
|
|
15148
15148
|
return mqtt.subscribe(topic, callback);
|
|
@@ -16842,9 +16842,9 @@ const createPost = async (bundle) => {
|
|
|
16842
16842
|
const client = getActiveClient();
|
|
16843
16843
|
client.log('post/createPost', bundle);
|
|
16844
16844
|
// API-FIX: backend rejects that we pass the dataType manually T_T
|
|
16845
|
-
if (!bundle.dataType || ['text', 'image', 'file'].includes(bundle.dataType))
|
|
16845
|
+
if (!bundle.dataType || ['text', 'image', 'file', 'video'].includes(bundle.dataType))
|
|
16846
16846
|
delete bundle.dataType;
|
|
16847
|
-
const { data } = await client.http.post('/api/
|
|
16847
|
+
const { data } = await client.http.post('/api/v4/posts', bundle);
|
|
16848
16848
|
const cachedAt = client.cache && Date.now();
|
|
16849
16849
|
if (client.cache)
|
|
16850
16850
|
ingestInCache(data, { cachedAt });
|
|
@@ -16876,7 +16876,7 @@ const createPost = async (bundle) => {
|
|
|
16876
16876
|
const updatePost = async (postId, patch) => {
|
|
16877
16877
|
const client = getActiveClient();
|
|
16878
16878
|
client.log('user/updatePost', patch);
|
|
16879
|
-
const { data } = await client.http.put(`/api/
|
|
16879
|
+
const { data } = await client.http.put(`/api/v4/posts/${encodeURIComponent(postId)}`, patch);
|
|
16880
16880
|
const cachedAt = client.cache && Date.now();
|
|
16881
16881
|
if (client.cache)
|
|
16882
16882
|
ingestInCache(data, { cachedAt });
|