@amityco/ts-sdk 7.8.7-495208f.0 → 7.8.7-4d7b9f99.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.
Files changed (20) hide show
  1. package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/fileRepository/api/getFile.d.ts +1 -1
  2. package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/fileRepository/api/getFile.d.ts.map +1 -1
  3. package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/fileRepository/api/getFile.js.map +1 -1
  4. package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/utils/linkedObject/categoryLinkedObject.js +1 -1
  5. package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/utils/linkedObject/categoryLinkedObject.js.map +1 -1
  6. package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/utils/linkedObject/communityLinkedObject.d.ts.map +1 -1
  7. package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/utils/linkedObject/communityLinkedObject.js +12 -1
  8. package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/utils/linkedObject/communityLinkedObject.js.map +1 -1
  9. package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/tsconfig.tsbuildinfo +1 -1
  10. package/dist/fileRepository/api/getFile.d.ts +1 -1
  11. package/dist/fileRepository/api/getFile.d.ts.map +1 -1
  12. package/dist/index.cjs.js +10 -1
  13. package/dist/index.esm.js +10 -1
  14. package/dist/index.umd.js +1 -1
  15. package/dist/utils/linkedObject/communityLinkedObject.d.ts.map +1 -1
  16. package/package.json +1 -1
  17. package/src/fileRepository/api/getFile.ts +1 -1
  18. package/src/utils/linkedObject/categoryLinkedObject.ts +1 -1
  19. package/src/utils/linkedObject/communityLinkedObject.ts +11 -0
  20. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"communityLinkedObject.d.ts","sourceRoot":"","sources":["../../../src/utils/linkedObject/communityLinkedObject.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,qBAAqB,cAAe,MAAM,iBAAiB,KAAG,MAAM,SAgDhF,CAAC"}
1
+ {"version":3,"file":"communityLinkedObject.d.ts","sourceRoot":"","sources":["../../../src/utils/linkedObject/communityLinkedObject.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,qBAAqB,cAAe,MAAM,iBAAiB,KAAG,MAAM,SAyDhF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amityco/ts-sdk",
3
- "version": "7.8.7-495208f.0",
3
+ "version": "7.8.7-4d7b9f99.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",
@@ -21,7 +21,7 @@ import { ingestInCache } from '~/cache/api/ingestInCache';
21
21
  * @async
22
22
  */
23
23
  export const getFile = async <T extends Amity.FileType = any>(
24
- fileId: Amity.File<any>['fileId'],
24
+ fileId: Amity.File<T>['fileId'],
25
25
  ): Promise<Amity.Cached<Amity.File>> => {
26
26
  const client = getActiveClient();
27
27
  client.log('file/getFile', fileId);
@@ -1,4 +1,4 @@
1
- import { pullFromCache } from '~/cache/api';
1
+ import { pullFromCache } from '~/cache/api/pullFromCache';
2
2
 
3
3
  export const categoryLinkedObject = (category: Amity.InternalCategory): Amity.Category => {
4
4
  return {
@@ -1,14 +1,25 @@
1
1
  import { InvitationTypeEnum } from '~/@types';
2
+ import { pullFromCache } from '~/cache/api/pullFromCache';
2
3
  import { getMyJoinRequest } from '~/communityRepository/internalAPI/getMyJoinRequest';
3
4
  import { joinRequest } from '~/communityRepository/internalAPI/joinCommunity';
4
5
  import { getJoinRequests } from '~/communityRepository/observers/getJoinRequests';
5
6
  import { createInvitations } from '~/invitationRepository/internalApi';
6
7
  import { getInvitation } from '~/invitationRepository/internalApi/getInvitation';
7
8
  import { getInvitations } from '~/invitationRepository/observers/getInvitations';
9
+ import { categoryLinkedObject } from './categoryLinkedObject';
8
10
 
9
11
  export const communityLinkedObject = (community: Amity.InternalCommunity): Amity.Community => {
10
12
  return {
11
13
  ...community,
14
+ get categories(): Amity.Category[] {
15
+ return community.categoryIds
16
+ .map(categoryId => {
17
+ const cacheData = pullFromCache<Amity.Category>(['category', 'get', categoryId]);
18
+ if (cacheData?.data) return categoryLinkedObject(cacheData.data);
19
+ return undefined;
20
+ })
21
+ .filter(category => !!category);
22
+ },
12
23
  createInvitations: async (userIds: string[]): Promise<void> => {
13
24
  await createInvitations({
14
25
  type: InvitationTypeEnum.CommunityMemberInvite,