@amityco/ts-sdk-react-native 7.26.0 → 7.26.1-0905139c.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/file.d.ts +11 -2
- package/dist/@types/domains/file.d.ts.map +1 -1
- package/dist/cache/utils/index.d.ts.map +1 -1
- package/dist/fileRepository/api/getFile.d.ts.map +1 -1
- package/dist/fileRepository/api/uploadImage.d.ts.map +1 -1
- package/dist/fileRepository/api/uploadVideo.d.ts.map +1 -1
- package/dist/index.cjs.js +72 -11
- package/dist/index.esm.js +72 -11
- package/dist/index.umd.js +1 -1
- package/dist/postRepository/events/parentPost.d.ts +32 -0
- package/dist/postRepository/events/parentPost.d.ts.map +1 -0
- package/dist/postRepository/events/tests/parentPost.test.d.ts +2 -0
- package/dist/postRepository/events/tests/parentPost.test.d.ts.map +1 -0
- package/dist/postRepository/events/utils.d.ts.map +1 -1
- package/dist/utils/linkedObject/fileLinkedObject.d.ts +2 -0
- package/dist/utils/linkedObject/fileLinkedObject.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/postLinkedObject.d.ts.map +1 -1
- package/dist/utils/tests/dummy/file.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The subset of a post payload needed to locate its parent.
|
|
3
|
+
*
|
|
4
|
+
* Both ids are declared non-nullable on {@link Amity.RawPost}, but events
|
|
5
|
+
* arrive with either one missing — and with null rather than undefined — so
|
|
6
|
+
* they are widened here to the shape the wire actually produces.
|
|
7
|
+
*/
|
|
8
|
+
declare type ChildPostIds = {
|
|
9
|
+
postId: Amity.RawPost['postId'];
|
|
10
|
+
parentId?: Amity.RawPost['parentId'] | null;
|
|
11
|
+
parentPostId?: Amity.RawPost['parentPostId'] | null;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Resolves the id of the parent post that a child-post payload belongs to.
|
|
15
|
+
*
|
|
16
|
+
* `parentId` and `parentPostId` name the same post, but a payload does not
|
|
17
|
+
* always carry both — and the delete/create child handlers decide *whether* a
|
|
18
|
+
* post is a child from `parentId` while reading the cache with `parentPostId`.
|
|
19
|
+
* When only the former is set that read builds `['post', 'get', undefined]`,
|
|
20
|
+
* which cannot match anything and, when the value is null, breaks key encoding
|
|
21
|
+
* outright. Reading whichever id is present keeps the decision and the lookup
|
|
22
|
+
* on the same post.
|
|
23
|
+
*
|
|
24
|
+
* @param post the child post payload
|
|
25
|
+
* @returns the parent post id, or undefined when the payload carries neither
|
|
26
|
+
*
|
|
27
|
+
* @category Post Events
|
|
28
|
+
* @hidden
|
|
29
|
+
*/
|
|
30
|
+
export declare const resolveParentPostId: (post: ChildPostIds) => string | undefined;
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=parentPost.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parentPost.d.ts","sourceRoot":"","sources":["../../../src/postRepository/events/parentPost.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,aAAK,YAAY,GAAG;IAClB,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;IAC5C,YAAY,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC;CACrD,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,mBAAmB,SAAU,YAAY,KAAG,MAAM,GAAG,SAmBjE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parentPost.test.d.ts","sourceRoot":"","sources":["../../../../src/postRepository/events/tests/parentPost.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/postRepository/events/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/postRepository/events/utils.ts"],"names":[],"mappings":"AA2DA,eAAO,MAAM,yBAAyB,UAC7B,MAAM,MAAM,cAAc,YACvB,MAAM,QAAQ,CAAC,MAAM,YAAY,CAAC,uBAwE7C,CAAC;AAEF,eAAO,MAAM,8BAA8B,UAClC,MAAM,KAAK,MAAM,eAAe,EAAE,wBAAwB,GAAG,2BAA2B,CAAC,YACtF,MAAM,QAAQ,CAAC,MAAM,YAAY,CAAC,uBA8B7C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileLinkedObject.d.ts","sourceRoot":"","sources":["../../../src/utils/linkedObject/fileLinkedObject.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,wGA6B5B,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const LinkedObject: {
|
|
2
|
+
file: <T extends Amity.FileType = any>(file?: Amity.FilePayload<T> | undefined) => Amity.File<T> | undefined;
|
|
2
3
|
ad: (ad: Amity.InternalAd) => Amity.Ad;
|
|
3
4
|
comment: (comment: Amity.InternalComment<any>) => Amity.Comment<any>;
|
|
4
5
|
post: (post: Amity.InternalPost<any>) => Amity.Post<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":"AAwBA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;CAwBxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postLinkedObject.d.ts","sourceRoot":"","sources":["../../../src/utils/linkedObject/postLinkedObject.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"postLinkedObject.d.ts","sourceRoot":"","sources":["../../../src/utils/linkedObject/postLinkedObject.ts"],"names":[],"mappings":"AAwBA,eAAO,MAAM,gBAAgB,SAAU,MAAM,YAAY,KAAG,MAAM,IAsLjE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../../src/utils/tests/dummy/file.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../../src/utils/tests/dummy/file.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAsBtC,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAmBtC,CAAC;AAEF,eAAO,MAAM,kBAAkB,gBAK9B,CAAC;AAEF,eAAO,MAAM,mBAAmB,gBAI/B,CAAC"}
|
package/package.json
CHANGED