@flashbacktech/flashbackclient 0.1.14 → 0.1.15

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.
@@ -4,6 +4,7 @@ import { ActivateResponse, DeactivateResponse, LoginBody, LoginResponse, LogoutR
4
4
  import { StatsQueryParams, StatsResponse, NodeStatsMinuteResponse, NodeStatsDailyResponse, NodeStatsQueryParams, UnitStatsResponse, RepoStatsResponse, NodeStatsDailyQueryParams } from './types/stats';
5
5
  import { NodeInfo } from './types/bridge';
6
6
  import { FeedbackEmailBody } from './types/email';
7
+ import { QuotaResponse } from './types/quota';
7
8
  interface ErrorResponse {
8
9
  message?: string;
9
10
  [key: string]: any;
@@ -62,6 +63,7 @@ export declare class ApiClient implements IApiClient {
62
63
  userLogout: (refreshToken: string) => Promise<LogoutResponse>;
63
64
  userActivate: () => Promise<ActivateResponse>;
64
65
  userDeactivate: () => Promise<DeactivateResponse>;
66
+ getUserQuota: () => Promise<QuotaResponse>;
65
67
  private validateDateRange;
66
68
  getDailyStats: (params: StatsQueryParams) => Promise<StatsResponse>;
67
69
  getMinuteStats: (params: StatsQueryParams) => Promise<StatsResponse>;
@@ -220,6 +220,9 @@ class ApiClient {
220
220
  this.userDeactivate = async () => {
221
221
  return this.makeRequest('user/deactivate', 'POST', null);
222
222
  };
223
+ this.getUserQuota = async () => {
224
+ return this.makeRequest('user/quota', 'GET', null);
225
+ };
223
226
  this.getDailyStats = async (params) => {
224
227
  this.validateDateRange(params.startDate, params.endDate);
225
228
  const queryParams = new URLSearchParams();
@@ -0,0 +1,33 @@
1
+ export declare enum PeriodType {
2
+ ALL_TIME = "ALL_TIME",
3
+ DAILY = "DAILY",
4
+ WEEKLY = "WEEKLY",
5
+ MONTHLY = "MONTHLY",
6
+ YEARLY = "YEARLY"
7
+ }
8
+ export interface SubscriptionInfo {
9
+ id: string;
10
+ name: string;
11
+ description: string;
12
+ }
13
+ export interface CapabilityInfo {
14
+ id: string;
15
+ code: string;
16
+ description: string;
17
+ type: string;
18
+ periodType: PeriodType;
19
+ }
20
+ export interface QuotaUsageInfo {
21
+ current: number;
22
+ max: number;
23
+ percentage: number;
24
+ }
25
+ export interface QuotaUsageItem {
26
+ capability: CapabilityInfo;
27
+ usage: QuotaUsageInfo;
28
+ }
29
+ export interface QuotaResponse {
30
+ success: boolean;
31
+ subscription: SubscriptionInfo;
32
+ quotaUsage: QuotaUsageItem[];
33
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PeriodType = void 0;
4
+ var PeriodType;
5
+ (function (PeriodType) {
6
+ PeriodType["ALL_TIME"] = "ALL_TIME";
7
+ PeriodType["DAILY"] = "DAILY";
8
+ PeriodType["WEEKLY"] = "WEEKLY";
9
+ PeriodType["MONTHLY"] = "MONTHLY";
10
+ PeriodType["YEARLY"] = "YEARLY";
11
+ })(PeriodType || (exports.PeriodType = PeriodType = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flashbacktech/flashbackclient",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "type": "commonjs",
5
5
  "publishConfig": {
6
6
  "access": "public"