@amityco/ts-sdk 7.8.7-4d7b9f99.0 → 7.8.7-b187841.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 (25) hide show
  1. package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/core/transports/http.d.ts.map +1 -1
  2. package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/core/transports/http.js +11 -5
  3. package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/core/transports/http.js.map +1 -1
  4. package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/fileRepository/api/getFile.d.ts +1 -1
  5. package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/fileRepository/api/getFile.d.ts.map +1 -1
  6. package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/fileRepository/api/getFile.js.map +1 -1
  7. package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/utils/linkedObject/categoryLinkedObject.js +1 -1
  8. package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/utils/linkedObject/categoryLinkedObject.js.map +1 -1
  9. package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/utils/linkedObject/communityLinkedObject.d.ts.map +1 -1
  10. package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/utils/linkedObject/communityLinkedObject.js +1 -12
  11. package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/utils/linkedObject/communityLinkedObject.js.map +1 -1
  12. package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/tsconfig.tsbuildinfo +1 -1
  13. package/dist/core/transports/http.d.ts.map +1 -1
  14. package/dist/fileRepository/api/getFile.d.ts +1 -1
  15. package/dist/fileRepository/api/getFile.d.ts.map +1 -1
  16. package/dist/index.cjs.js +12 -15
  17. package/dist/index.esm.js +12 -15
  18. package/dist/index.umd.js +2 -2
  19. package/dist/utils/linkedObject/communityLinkedObject.d.ts.map +1 -1
  20. package/package.json +1 -1
  21. package/src/core/transports/http.ts +18 -13
  22. package/src/fileRepository/api/getFile.ts +1 -1
  23. package/src/utils/linkedObject/categoryLinkedObject.ts +1 -1
  24. package/src/utils/linkedObject/communityLinkedObject.ts +0 -11
  25. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
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"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amityco/ts-sdk",
3
- "version": "7.8.7-4d7b9f99.0",
3
+ "version": "7.8.7-b187841.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",
@@ -143,19 +143,24 @@ export const createHttpTransport = (endpoint: string) => {
143
143
  }
144
144
  });
145
145
 
146
- NetworkActivitiesWatcher.getInstance().setNetworkActivities(
147
- new Request(response.request.url, {
148
- method: response.request.method,
149
- headers: response.request.headers,
150
- body: response.request.data,
151
- }),
152
- {
153
- data: response.data,
154
- status: response.status,
155
- statusText: response.statusText,
156
- headers: responseHeaders,
157
- },
158
- );
146
+ const url = (response.config.baseURL || '') + (response.config.url || '');
147
+ const method = response.config.method?.toUpperCase();
148
+
149
+ const requestInit: RequestInit = {
150
+ method,
151
+ headers: response.config.headers,
152
+ };
153
+
154
+ if (method !== 'GET' && method !== 'HEAD') {
155
+ requestInit.body = response.config.data;
156
+ }
157
+
158
+ NetworkActivitiesWatcher.getInstance().setNetworkActivities(new Request(url, requestInit), {
159
+ data: response.data,
160
+ status: response.status,
161
+ statusText: response.statusText,
162
+ headers: responseHeaders,
163
+ });
159
164
 
160
165
  return response;
161
166
  },
@@ -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<T>['fileId'],
24
+ fileId: Amity.File<any>['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/pullFromCache';
1
+ import { pullFromCache } from '~/cache/api';
2
2
 
3
3
  export const categoryLinkedObject = (category: Amity.InternalCategory): Amity.Category => {
4
4
  return {
@@ -1,25 +1,14 @@
1
1
  import { InvitationTypeEnum } from '~/@types';
2
- import { pullFromCache } from '~/cache/api/pullFromCache';
3
2
  import { getMyJoinRequest } from '~/communityRepository/internalAPI/getMyJoinRequest';
4
3
  import { joinRequest } from '~/communityRepository/internalAPI/joinCommunity';
5
4
  import { getJoinRequests } from '~/communityRepository/observers/getJoinRequests';
6
5
  import { createInvitations } from '~/invitationRepository/internalApi';
7
6
  import { getInvitation } from '~/invitationRepository/internalApi/getInvitation';
8
7
  import { getInvitations } from '~/invitationRepository/observers/getInvitations';
9
- import { categoryLinkedObject } from './categoryLinkedObject';
10
8
 
11
9
  export const communityLinkedObject = (community: Amity.InternalCommunity): Amity.Community => {
12
10
  return {
13
11
  ...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
- },
23
12
  createInvitations: async (userIds: string[]): Promise<void> => {
24
13
  await createInvitations({
25
14
  type: InvitationTypeEnum.CommunityMemberInvite,