@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.
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/core/transports/http.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/core/transports/http.js +11 -5
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/core/transports/http.js.map +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/fileRepository/api/getFile.d.ts +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/fileRepository/api/getFile.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/fileRepository/api/getFile.js.map +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/utils/linkedObject/categoryLinkedObject.js +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/utils/linkedObject/categoryLinkedObject.js.map +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/utils/linkedObject/communityLinkedObject.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/utils/linkedObject/communityLinkedObject.js +1 -12
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/utils/linkedObject/communityLinkedObject.js.map +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/tsconfig.tsbuildinfo +1 -1
- package/dist/core/transports/http.d.ts.map +1 -1
- package/dist/fileRepository/api/getFile.d.ts +1 -1
- package/dist/fileRepository/api/getFile.d.ts.map +1 -1
- package/dist/index.cjs.js +12 -15
- package/dist/index.esm.js +12 -15
- package/dist/index.umd.js +2 -2
- package/dist/utils/linkedObject/communityLinkedObject.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/core/transports/http.ts +18 -13
- package/src/fileRepository/api/getFile.ts +1 -1
- package/src/utils/linkedObject/categoryLinkedObject.ts +1 -1
- package/src/utils/linkedObject/communityLinkedObject.ts +0 -11
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"communityLinkedObject.d.ts","sourceRoot":"","sources":["../../../src/utils/linkedObject/communityLinkedObject.ts"],"names":[],"mappings":"
|
|
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
|
@@ -143,19 +143,24 @@ export const createHttpTransport = (endpoint: string) => {
|
|
|
143
143
|
}
|
|
144
144
|
});
|
|
145
145
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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<
|
|
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,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,
|