@flashbacktech/flashbackclient 0.1.22 → 0.1.23

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.
@@ -3,7 +3,6 @@ import { IApiClient, ProviderType } from './interfaces';
3
3
  import { ActivateResponse, DeactivateResponse, LoginBody, LoginResponse, LogoutResponse, OAuth2ResponseDTO, RefreshTokenErrorResponse, RefreshTokenResponse, RegisterBody, RegisterResponse, ResetPasswordBody } from './types/auth';
4
4
  import { StatsQueryParams, StatsResponse, NodeStatsMinuteResponse, NodeStatsDailyResponse, NodeStatsQueryParams, UnitStatsResponse, RepoStatsResponse, NodeStatsDailyQueryParams } from './types/stats';
5
5
  import { NodeInfo } from './types/bridge';
6
- import { FeedbackEmailBody } from './types/email';
7
6
  import { QuotaResponse } from './types/quota';
8
7
  interface ErrorResponse {
9
8
  message?: string;
@@ -80,6 +79,6 @@ export declare class ApiClient implements IApiClient {
80
79
  unitId?: string[];
81
80
  }) => Promise<UnitStatsResponse>;
82
81
  getNodeInfo: () => Promise<NodeInfo[]>;
83
- sendFeedbackEmail: (data: FeedbackEmailBody) => Promise<ActionResponse>;
82
+ sendFeedbackEmail: (data: FormData) => Promise<ActionResponse>;
84
83
  }
85
84
  export {};
@@ -80,12 +80,13 @@ class ApiClient {
80
80
  throw new Error('Not implemented');
81
81
  };
82
82
  this.makeRequest = async (path, method, data) => {
83
+ const isFormData = data instanceof FormData;
83
84
  const options = {
84
85
  method,
85
86
  headers: this.headers,
86
- body: data ? JSON.stringify(data) : null,
87
+ body: data ? (isFormData ? data : JSON.stringify(data)) : null,
87
88
  };
88
- if (data) {
89
+ if (data && !isFormData) {
89
90
  options.headers = {
90
91
  ...options.headers,
91
92
  'Content-Type': 'application/json',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flashbacktech/flashbackclient",
3
- "version": "0.1.22",
3
+ "version": "0.1.23",
4
4
  "type": "commonjs",
5
5
  "publishConfig": {
6
6
  "access": "public"