@inline-chat/realtime-sdk 0.0.4 → 0.0.5

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.
@@ -209,7 +209,7 @@ export class InlineSdkClient {
209
209
  form.set("height", String(height));
210
210
  form.set("duration", String(duration));
211
211
  }
212
- const response = await this.fetchImpl(new URL("uploadFile", `${this.httpBaseUrl}/`), {
212
+ const response = await this.fetchImpl(resolveUploadFileUrl(this.httpBaseUrl), {
213
213
  method: "POST",
214
214
  headers: {
215
215
  authorization: `Bearer ${this.options.token}`,
@@ -754,5 +754,11 @@ const resolveRealtimeUrl = (baseUrl) => {
754
754
  url.pathname = url.pathname.replace(/\/+$/, "") + "/realtime";
755
755
  return url.toString();
756
756
  };
757
+ const resolveUploadFileUrl = (baseUrl) => {
758
+ const url = new URL(baseUrl);
759
+ const basePath = url.pathname.replace(/\/+$/, "");
760
+ url.pathname = `${basePath}/v1/uploadFile`;
761
+ return url;
762
+ };
757
763
  const hasMethodMapping = (method) => Object.prototype.hasOwnProperty.call(rpcInputKindByMethod, method) &&
758
764
  Object.prototype.hasOwnProperty.call(rpcResultKindByMethod, method);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inline-chat/realtime-sdk",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [