@amityco/ts-sdk 7.9.2-595dc25e.0 → 7.9.2-9906a74f.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/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/@types/domains/feed.d.ts +1 -4
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/@types/domains/feed.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/@types/domains/feed.js +0 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/@types/domains/feed.js.map +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/@types/domains/pinnedPost.d.ts +1 -4
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/@types/domains/pinnedPost.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/@types/domains/pinnedPost.js.map +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/@types/domains/post.d.ts +0 -15
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/@types/domains/post.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/@types/domains/post.js +0 -9
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/@types/domains/post.js.map +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/fileRepository/api/uploadAudio.js +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/fileRepository/api/uploadAudio.js.map +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/postRepository/api/createAudioPost.d.ts +4 -4
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/postRepository/api/createAudioPost.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/postRepository/api/createAudioPost.js.map +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/postRepository/api/index.d.ts +0 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/postRepository/api/index.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/postRepository/api/index.js +0 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/postRepository/api/index.js.map +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/postRepository/observers/getGlobalPinnedPosts/GlobalPinnedPostPaginationController.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/postRepository/observers/getGlobalPinnedPosts/GlobalPinnedPostPaginationController.js +1 -3
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/postRepository/observers/getGlobalPinnedPosts/GlobalPinnedPostPaginationController.js.map +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/postRepository/observers/getPinnedPosts/PinnedPostPaginationController.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/postRepository/observers/getPinnedPosts/PinnedPostPaginationController.js +2 -4
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/postRepository/observers/getPinnedPosts/PinnedPostPaginationController.js.map +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/tsconfig.tsbuildinfo +1 -1
- package/dist/@types/domains/feed.d.ts +1 -4
- package/dist/@types/domains/feed.d.ts.map +1 -1
- package/dist/@types/domains/pinnedPost.d.ts +1 -4
- package/dist/@types/domains/pinnedPost.d.ts.map +1 -1
- package/dist/@types/domains/post.d.ts +0 -15
- package/dist/@types/domains/post.d.ts.map +1 -1
- package/dist/index.cjs.js +5 -65
- package/dist/index.esm.js +6 -65
- package/dist/index.umd.js +3 -3
- package/dist/postRepository/api/createAudioPost.d.ts +4 -4
- package/dist/postRepository/api/createAudioPost.d.ts.map +1 -1
- package/dist/postRepository/api/index.d.ts +0 -1
- package/dist/postRepository/api/index.d.ts.map +1 -1
- package/dist/postRepository/observers/getGlobalPinnedPosts/GlobalPinnedPostPaginationController.d.ts.map +1 -1
- package/dist/postRepository/observers/getPinnedPosts/PinnedPostPaginationController.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/@types/domains/feed.ts +1 -4
- package/src/@types/domains/pinnedPost.ts +1 -4
- package/src/@types/domains/post.ts +0 -21
- package/src/fileRepository/api/uploadAudio.ts +1 -1
- package/src/postRepository/api/createAudioPost.ts +1 -1
- package/src/postRepository/api/index.ts +0 -1
- package/src/postRepository/observers/getGlobalPinnedPosts/GlobalPinnedPostPaginationController.ts +0 -3
- package/src/postRepository/observers/getPinnedPosts/PinnedPostPaginationController.ts +1 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/postRepository/api/createMixedMediaPost.d.ts +0 -35
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/postRepository/api/createMixedMediaPost.d.ts.map +0 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/postRepository/api/createMixedMediaPost.js +0 -49
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/postRepository/api/createMixedMediaPost.js.map +0 -1
- package/dist/postRepository/api/createMixedMediaPost.d.ts +0 -35
- package/dist/postRepository/api/createMixedMediaPost.d.ts.map +0 -1
- package/src/postRepository/api/createMixedMediaPost.ts +0 -62
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ```js
|
|
3
|
-
* import { PostRepository } from '@amityco/ts-sdk'
|
|
4
|
-
* const { data } = await PostRepository.createMixedMediaPost({
|
|
5
|
-
* targetType: 'community',
|
|
6
|
-
* targetId: 'community123',
|
|
7
|
-
* data: { text: 'Check out my mixed media post!', title: 'Mixed Media Post' },
|
|
8
|
-
* attachments: [
|
|
9
|
-
* { fileId: "file1", type: "image" },
|
|
10
|
-
* { fileId: "file2", type: "video" },
|
|
11
|
-
* { fileId: "file3", type: "audio" },
|
|
12
|
-
* { fileId: "file4", type: "file" }
|
|
13
|
-
* ],
|
|
14
|
-
* })
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* Creates an {@link Amity.Post}
|
|
18
|
-
*
|
|
19
|
-
* @param bundle The data necessary to create a new {@link Amity.Post}
|
|
20
|
-
* @returns The newly created {@link Amity.Post}
|
|
21
|
-
*
|
|
22
|
-
* @category Post API
|
|
23
|
-
* @async
|
|
24
|
-
*/
|
|
25
|
-
export declare const createMixedMediaPost: <T extends Amity.MixedMediaPostContentType>(bundle: Pick<Amity.Post<T>, "targetId" | "targetType"> & Partial<Pick<Amity.Post<T>, "tags" | "metadata" | "mentionees" | "hashtags">> & {
|
|
26
|
-
data?: {
|
|
27
|
-
text?: string | undefined;
|
|
28
|
-
title?: string | undefined;
|
|
29
|
-
} | undefined;
|
|
30
|
-
attachments: {
|
|
31
|
-
type: T;
|
|
32
|
-
fileId: Amity.File['fileId'];
|
|
33
|
-
}[];
|
|
34
|
-
}) => Promise<Amity.Cached<Amity.Post>>;
|
|
35
|
-
//# sourceMappingURL=createMixedMediaPost.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createMixedMediaPost.d.ts","sourceRoot":"","sources":["../../../src/postRepository/api/createMixedMediaPost.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,oBAAoB;;;;;;;gBAOK,UAAU,CAAC,QAAQ,CAAC;;MAEvD,QAAQ,MAAM,MAAM,CAAC,MAAM,IAAI,CAAC,CAkBlC,CAAC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { fireEvent } from '~/core/events';
|
|
2
|
-
import { preparePostPayload } from '../utils/payload';
|
|
3
|
-
import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
4
|
-
import { getActiveClient } from '~/client/api/activeClient';
|
|
5
|
-
import { postLinkedObject } from '~/utils/linkedObject/postLinkedObject';
|
|
6
|
-
/* begin_public_function
|
|
7
|
-
id: post.create.mixed_media_post
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* ```js
|
|
11
|
-
* import { PostRepository } from '@amityco/ts-sdk'
|
|
12
|
-
* const { data } = await PostRepository.createMixedMediaPost({
|
|
13
|
-
* targetType: 'community',
|
|
14
|
-
* targetId: 'community123',
|
|
15
|
-
* data: { text: 'Check out my mixed media post!', title: 'Mixed Media Post' },
|
|
16
|
-
* attachments: [
|
|
17
|
-
* { fileId: "file1", type: "image" },
|
|
18
|
-
* { fileId: "file2", type: "video" },
|
|
19
|
-
* { fileId: "file3", type: "audio" },
|
|
20
|
-
* { fileId: "file4", type: "file" }
|
|
21
|
-
* ],
|
|
22
|
-
* })
|
|
23
|
-
* ```
|
|
24
|
-
*
|
|
25
|
-
* Creates an {@link Amity.Post}
|
|
26
|
-
*
|
|
27
|
-
* @param bundle The data necessary to create a new {@link Amity.Post}
|
|
28
|
-
* @returns The newly created {@link Amity.Post}
|
|
29
|
-
*
|
|
30
|
-
* @category Post API
|
|
31
|
-
* @async
|
|
32
|
-
*/
|
|
33
|
-
export const createMixedMediaPost = async (bundle) => {
|
|
34
|
-
var _a;
|
|
35
|
-
const client = getActiveClient();
|
|
36
|
-
client.log('post/createMixedMediaPost', bundle);
|
|
37
|
-
const { data: payload } = await client.http.post('/api/v4/posts', bundle);
|
|
38
|
-
fireEvent('post.created', payload);
|
|
39
|
-
const data = preparePostPayload(payload);
|
|
40
|
-
const cachedAt = client.cache && Date.now();
|
|
41
|
-
if (client.cache)
|
|
42
|
-
ingestInCache(data, { cachedAt });
|
|
43
|
-
return {
|
|
44
|
-
data: postLinkedObject((_a = data === null || data === void 0 ? void 0 : data.posts) === null || _a === void 0 ? void 0 : _a[0]),
|
|
45
|
-
cachedAt,
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
/* end_public_function */
|
|
49
|
-
//# sourceMappingURL=createMixedMediaPost.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createMixedMediaPost.js","sourceRoot":"","sources":["../../../src/postRepository/api/createMixedMediaPost.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAEzE;;EAEE;AACF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,EACvC,MAOG,EACgC,EAAE;;IACrC,MAAM,MAAM,GAAG,eAAe,EAAE,CAAC;IACjC,MAAM,CAAC,GAAG,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC;IAEhD,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAoB,eAAe,EAAE,MAAM,CAAC,CAAC;IAE7F,SAAS,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAEnC,MAAM,IAAI,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAEzC,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;IAE5C,IAAI,MAAM,CAAC,KAAK;QAAE,aAAa,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;IAEpD,OAAO;QACL,IAAI,EAAE,gBAAgB,CAAC,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,0CAAG,CAAC,CAAC,CAAC;QACxC,QAAQ;KACT,CAAC;AACJ,CAAC,CAAC;AACF,yBAAyB","sourcesContent":["import { fireEvent } from '~/core/events';\nimport { preparePostPayload } from '../utils/payload';\nimport { ingestInCache } from '~/cache/api/ingestInCache';\nimport { getActiveClient } from '~/client/api/activeClient';\nimport { postLinkedObject } from '~/utils/linkedObject/postLinkedObject';\n\n/* begin_public_function\n id: post.create.mixed_media_post\n*/\n/**\n * ```js\n * import { PostRepository } from '@amityco/ts-sdk'\n * const { data } = await PostRepository.createMixedMediaPost({\n * targetType: 'community',\n * targetId: 'community123',\n * data: { text: 'Check out my mixed media post!', title: 'Mixed Media Post' },\n * attachments: [\n * { fileId: \"file1\", type: \"image\" },\n * { fileId: \"file2\", type: \"video\" },\n * { fileId: \"file3\", type: \"audio\" },\n * { fileId: \"file4\", type: \"file\" }\n * ],\n * })\n * ```\n *\n * Creates an {@link Amity.Post}\n *\n * @param bundle The data necessary to create a new {@link Amity.Post}\n * @returns The newly created {@link Amity.Post}\n *\n * @category Post API\n * @async\n */\nexport const createMixedMediaPost = async <T extends Amity.MixedMediaPostContentType>(\n bundle: Pick<Amity.Post<T>, 'targetType' | 'targetId'> &\n Partial<Pick<Amity.Post<T>, 'metadata' | 'mentionees' | 'tags' | 'hashtags'>> & {\n data?: {\n text?: string;\n title?: string;\n };\n attachments: { type: T; fileId: Amity.File['fileId'] }[];\n },\n): Promise<Amity.Cached<Amity.Post>> => {\n const client = getActiveClient();\n client.log('post/createMixedMediaPost', bundle);\n\n const { data: payload } = await client.http.post<Amity.PostPayload>('/api/v4/posts', bundle);\n\n fireEvent('post.created', payload);\n\n const data = preparePostPayload(payload);\n\n const cachedAt = client.cache && Date.now();\n\n if (client.cache) ingestInCache(data, { cachedAt });\n\n return {\n data: postLinkedObject(data?.posts?.[0]),\n cachedAt,\n };\n};\n/* end_public_function */\n"]}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ```js
|
|
3
|
-
* import { PostRepository } from '@amityco/ts-sdk'
|
|
4
|
-
* const { data } = await PostRepository.createMixedMediaPost({
|
|
5
|
-
* targetType: 'community',
|
|
6
|
-
* targetId: 'community123',
|
|
7
|
-
* data: { text: 'Check out my mixed media post!', title: 'Mixed Media Post' },
|
|
8
|
-
* attachments: [
|
|
9
|
-
* { fileId: "file1", type: "image" },
|
|
10
|
-
* { fileId: "file2", type: "video" },
|
|
11
|
-
* { fileId: "file3", type: "audio" },
|
|
12
|
-
* { fileId: "file4", type: "file" }
|
|
13
|
-
* ],
|
|
14
|
-
* })
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* Creates an {@link Amity.Post}
|
|
18
|
-
*
|
|
19
|
-
* @param bundle The data necessary to create a new {@link Amity.Post}
|
|
20
|
-
* @returns The newly created {@link Amity.Post}
|
|
21
|
-
*
|
|
22
|
-
* @category Post API
|
|
23
|
-
* @async
|
|
24
|
-
*/
|
|
25
|
-
export declare const createMixedMediaPost: <T extends Amity.MixedMediaPostContentType>(bundle: Pick<Amity.Post<T>, "targetId" | "targetType"> & Partial<Pick<Amity.Post<T>, "tags" | "metadata" | "mentionees" | "hashtags">> & {
|
|
26
|
-
data?: {
|
|
27
|
-
text?: string | undefined;
|
|
28
|
-
title?: string | undefined;
|
|
29
|
-
} | undefined;
|
|
30
|
-
attachments: {
|
|
31
|
-
type: T;
|
|
32
|
-
fileId: Amity.File['fileId'];
|
|
33
|
-
}[];
|
|
34
|
-
}) => Promise<Amity.Cached<Amity.Post>>;
|
|
35
|
-
//# sourceMappingURL=createMixedMediaPost.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createMixedMediaPost.d.ts","sourceRoot":"","sources":["../../../src/postRepository/api/createMixedMediaPost.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,oBAAoB;;;;;;;gBAOK,UAAU,CAAC,QAAQ,CAAC;;MAEvD,QAAQ,MAAM,MAAM,CAAC,MAAM,IAAI,CAAC,CAkBlC,CAAC"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { fireEvent } from '~/core/events';
|
|
2
|
-
import { preparePostPayload } from '../utils/payload';
|
|
3
|
-
import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
4
|
-
import { getActiveClient } from '~/client/api/activeClient';
|
|
5
|
-
import { postLinkedObject } from '~/utils/linkedObject/postLinkedObject';
|
|
6
|
-
|
|
7
|
-
/* begin_public_function
|
|
8
|
-
id: post.create.mixed_media_post
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* ```js
|
|
12
|
-
* import { PostRepository } from '@amityco/ts-sdk'
|
|
13
|
-
* const { data } = await PostRepository.createMixedMediaPost({
|
|
14
|
-
* targetType: 'community',
|
|
15
|
-
* targetId: 'community123',
|
|
16
|
-
* data: { text: 'Check out my mixed media post!', title: 'Mixed Media Post' },
|
|
17
|
-
* attachments: [
|
|
18
|
-
* { fileId: "file1", type: "image" },
|
|
19
|
-
* { fileId: "file2", type: "video" },
|
|
20
|
-
* { fileId: "file3", type: "audio" },
|
|
21
|
-
* { fileId: "file4", type: "file" }
|
|
22
|
-
* ],
|
|
23
|
-
* })
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* Creates an {@link Amity.Post}
|
|
27
|
-
*
|
|
28
|
-
* @param bundle The data necessary to create a new {@link Amity.Post}
|
|
29
|
-
* @returns The newly created {@link Amity.Post}
|
|
30
|
-
*
|
|
31
|
-
* @category Post API
|
|
32
|
-
* @async
|
|
33
|
-
*/
|
|
34
|
-
export const createMixedMediaPost = async <T extends Amity.MixedMediaPostContentType>(
|
|
35
|
-
bundle: Pick<Amity.Post<T>, 'targetType' | 'targetId'> &
|
|
36
|
-
Partial<Pick<Amity.Post<T>, 'metadata' | 'mentionees' | 'tags' | 'hashtags'>> & {
|
|
37
|
-
data?: {
|
|
38
|
-
text?: string;
|
|
39
|
-
title?: string;
|
|
40
|
-
};
|
|
41
|
-
attachments: { type: T; fileId: Amity.File['fileId'] }[];
|
|
42
|
-
},
|
|
43
|
-
): Promise<Amity.Cached<Amity.Post>> => {
|
|
44
|
-
const client = getActiveClient();
|
|
45
|
-
client.log('post/createMixedMediaPost', bundle);
|
|
46
|
-
|
|
47
|
-
const { data: payload } = await client.http.post<Amity.PostPayload>('/api/v4/posts', bundle);
|
|
48
|
-
|
|
49
|
-
fireEvent('post.created', payload);
|
|
50
|
-
|
|
51
|
-
const data = preparePostPayload(payload);
|
|
52
|
-
|
|
53
|
-
const cachedAt = client.cache && Date.now();
|
|
54
|
-
|
|
55
|
-
if (client.cache) ingestInCache(data, { cachedAt });
|
|
56
|
-
|
|
57
|
-
return {
|
|
58
|
-
data: postLinkedObject(data?.posts?.[0]),
|
|
59
|
-
cachedAt,
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
/* end_public_function */
|