@amityco/ts-sdk 7.1.1-279cf96.0 → 7.1.1-53d7c83.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amityco/ts-sdk",
3
- "version": "7.1.1-279cf96.0",
3
+ "version": "7.1.1-53d7c83.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",
@@ -36,7 +36,6 @@ declare global {
36
36
 
37
37
  log: Logger;
38
38
  http: AxiosInstance;
39
- upload: AxiosInstance;
40
39
  mqtt?: Amity.MqttClient;
41
40
  ws?: SocketIOClient.Socket;
42
41
  emitter: Emitter<Amity.Events>;
@@ -50,7 +50,7 @@ export const createClient = (
50
50
  rteEnabled = true,
51
51
  }: {
52
52
  debugSession?: string;
53
- apiEndpoint?: { http?: string; mqtt?: string; upload?: string };
53
+ apiEndpoint?: { http?: string; mqtt?: string };
54
54
  prefixDeviceIdKey?: string;
55
55
  rteEnabled?: boolean;
56
56
  } = {},
@@ -63,11 +63,9 @@ export const createClient = (
63
63
  });
64
64
 
65
65
  const httpEndpoint = apiEndpoint?.http ?? computeUrl('http', apiRegion);
66
- const uploadEndpoint = apiEndpoint?.upload ?? computeUrl('upload', apiRegion);
67
66
  const mqttEndpoint = apiEndpoint?.mqtt ?? computeUrl('mqtt', apiRegion);
68
67
 
69
68
  const http = createHttpTransport(httpEndpoint);
70
- const upload = createHttpTransport(uploadEndpoint);
71
69
 
72
70
  let ws;
73
71
  let mqtt;
@@ -107,7 +105,6 @@ export const createClient = (
107
105
  http,
108
106
  ws,
109
107
  mqtt,
110
- upload,
111
108
  emitter,
112
109
 
113
110
  /*
@@ -6,7 +6,6 @@ export const API_REGIONS = {
6
6
 
7
7
  const URLS = {
8
8
  http: 'https://apix.{region}.amity.co',
9
- upload: 'https://upload.{region}.amity.co',
10
9
  mqtt: 'wss://sse.{region}.amity.co:443/mqtt',
11
10
  } as const;
12
11
 
@@ -30,14 +30,6 @@ export const setClientToken = async (params: Parameters<typeof getToken>[0]) =>
30
30
  isUserDeleted: false,
31
31
  };
32
32
 
33
- client.upload.defaults.headers.common.Authorization = `Bearer ${accessToken}`;
34
-
35
- client.upload.defaults.metadata = {
36
- tokenExpiry: expiresAt,
37
- isGlobalBanned: false,
38
- isUserDeleted: false,
39
- };
40
-
41
33
  // manually setup the token for ws transport
42
34
  if (client.ws) client.ws.io.opts.query = { token: accessToken };
43
35
 
@@ -42,7 +42,7 @@ export const uploadFile = async <T extends Amity.FileType = any>(
42
42
  ? (formData as any).getHeaders()
43
43
  : { 'content-type': 'multipart/form-data' };
44
44
 
45
- const { data } = await client.upload.post<Amity.CreateFilePayload<T>>('/api/v4/files', formData, {
45
+ const { data } = await client.http.post<Amity.CreateFilePayload<T>>('/api/v4/files', formData, {
46
46
  headers,
47
47
  onUploadProgress({ loaded, total = 100 }) {
48
48
  onProgress && onProgress(Math.round((loaded * 100) / total));
@@ -42,7 +42,7 @@ export const uploadImage = async (
42
42
  ? (formData as any).getHeaders()
43
43
  : { 'content-type': 'multipart/form-data' };
44
44
 
45
- const { data } = await client.upload.post<Amity.CreateFilePayload<'image'>>(
45
+ const { data } = await client.http.post<Amity.CreateFilePayload<'image'>>(
46
46
  '/api/v4/images',
47
47
  formData,
48
48
  {
@@ -48,7 +48,7 @@ export const uploadVideo = async (
48
48
  ? (formData as any).getHeaders()
49
49
  : { 'content-type': 'multipart/form-data' };
50
50
 
51
- const { data } = await client.upload.post<Amity.CreateFilePayload<'video'>>(
51
+ const { data } = await client.http.post<Amity.CreateFilePayload<'video'>>(
52
52
  '/api/v4/videos',
53
53
  formData,
54
54
  {