@mytmpvpn/mytmpvpn-common 7.0.0 → 9.0.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.
@@ -6,4 +6,6 @@ export interface PeanutsPack {
6
6
  price: number;
7
7
  description: string[];
8
8
  }
9
+ export type GetPeanutsPackResponse = PeanutsPack[];
10
+ export type GetPeanutsBalanceResponse = number;
9
11
  export declare function peanutsToClient(peanuts: number): number;
@@ -6,13 +6,11 @@ export interface ReferralCode {
6
6
  }
7
7
  export interface ReferralStats {
8
8
  totalReferrals: number;
9
- successfulReferrals: number;
10
9
  totalRewardsEarned: number;
11
10
  }
12
11
  export interface ReferralRelationship {
13
12
  referralCode: string;
14
13
  createdAt: string;
15
- rewardsProcessed: boolean;
16
14
  referrerReward: number;
17
15
  refereeReward: number;
18
16
  version: string;
@@ -24,14 +22,17 @@ export interface ValidateReferralCodeResponse {
24
22
  isValid?: boolean;
25
23
  error?: string;
26
24
  }
27
- export type GetReferralCodeResponse = string;
28
- export type GetReferrerCodeResponse = string | undefined;
25
+ export interface GetReferralCodeResponse {
26
+ referralCode: string;
27
+ }
28
+ export interface GetReferrerCodeResponse {
29
+ referralCode?: string;
30
+ }
29
31
  export type GetReferralStatsResponse = ReferralStats;
30
32
  export interface ReferralHistoryItem {
31
33
  relationshipId: string;
32
34
  referralCode: string;
33
35
  createdAt: string;
34
- rewardsProcessed: boolean;
35
36
  referrerReward: number;
36
37
  refereeReward: number;
37
38
  }
@@ -8,7 +8,7 @@ function validateReferralCodeSyntax(code) {
8
8
  loglevel_1.default.error(`Referral code cannot be null or undefined: `, code);
9
9
  throw new errors_1.InvalidReferralCodeError(code);
10
10
  }
11
- if (!code || code.trim() === '') {
11
+ if (code.trim() === '') {
12
12
  loglevel_1.default.error(`Referral code cannot be empty: `, code);
13
13
  throw new errors_1.InvalidReferralCodeError(code);
14
14
  }
@@ -41,6 +41,43 @@ export interface Vpn {
41
41
  config: VpnConfig;
42
42
  state: VpnState;
43
43
  }
44
+ export type GetVpnConfigLimitsResponse = VpnConfigLimits;
45
+ export type ListVpnsResponse = Vpn[];
46
+ export interface DeleteVpnResponse {
47
+ vpn: {
48
+ href: string;
49
+ id: string;
50
+ };
51
+ }
52
+ export interface CreateVpnResponse {
53
+ vpn: {
54
+ href: string;
55
+ id: string;
56
+ };
57
+ }
58
+ export interface GetVpnResponse {
59
+ vpn: Vpn;
60
+ metrics: VpnMetrics;
61
+ }
62
+ export interface RegionInfo {
63
+ name: string;
64
+ city: string;
65
+ country: string;
66
+ cctld: string;
67
+ }
68
+ export type GetVpnConfigResponse = string;
69
+ export type ListRegionsResponse = string[];
70
+ export type ListRegionsDetailedResponse = RegionInfo[];
71
+ export type ListVpnsPagingParams = {
72
+ pageSize: Number;
73
+ nextPageToken: string | undefined;
74
+ };
75
+ export type ListVpnsPaginatedResponse = {
76
+ totalVpns: number;
77
+ totalPages: number;
78
+ vpns: Vpn[];
79
+ nextPageToken: string | undefined;
80
+ };
44
81
  export declare function getVpnConfigTypes(): VpnType[];
45
82
  export declare function vpnAgainstQuotaPredicate(uservpn: UserVpn): boolean;
46
83
  export declare function validateVpnNbAgainstQuota(vpnNb: number, quota: number): number;
@@ -0,0 +1 @@
1
+ {"root":["../.eslintrc.js","../jest.config.js","../src/errors.ts","../src/index.ts","../src/utils.ts","../src/models/index.ts","../src/models/peanuts.ts","../src/models/referral.ts","../src/models/uservpn.ts","../src/models/vpn.ts","../test/models.test.ts"],"version":"5.9.3"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mytmpvpn/mytmpvpn-common",
3
- "version": "7.0.0",
3
+ "version": "9.0.0",
4
4
  "description": "Common library for all MyTmpVpn related projects",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [