@internxt/sdk 1.5.25 → 1.6.4
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/dist/auth/index.d.ts +127 -122
- package/dist/auth/index.js +378 -310
- package/dist/auth/types.d.ts +65 -54
- package/dist/auth/types.js +26 -26
- package/dist/drive/backups/index.d.ts +18 -18
- package/dist/drive/backups/index.js +40 -40
- package/dist/drive/backups/types.d.ts +27 -27
- package/dist/drive/backups/types.js +2 -2
- package/dist/drive/index.d.ts +7 -7
- package/dist/drive/index.js +23 -19
- package/dist/drive/payments/index.d.ts +66 -71
- package/dist/drive/payments/index.js +206 -208
- package/dist/drive/payments/types.d.ts +180 -176
- package/dist/drive/payments/types.js +37 -37
- package/dist/drive/referrals/index.d.ts +19 -19
- package/dist/drive/referrals/index.js +54 -50
- package/dist/drive/referrals/types.d.ts +21 -21
- package/dist/drive/referrals/types.js +18 -18
- package/dist/drive/share/index.d.ts +319 -319
- package/dist/drive/share/index.js +544 -540
- package/dist/drive/share/types.d.ts +360 -360
- package/dist/drive/share/types.js +2 -2
- package/dist/drive/storage/index.d.ts +315 -315
- package/dist/drive/storage/index.js +634 -630
- package/dist/drive/storage/types.d.ts +480 -473
- package/dist/drive/storage/types.js +13 -13
- package/dist/drive/trash/index.d.ts +75 -75
- package/dist/drive/trash/index.js +184 -180
- package/dist/drive/trash/types.d.ts +29 -29
- package/dist/drive/trash/types.js +2 -2
- package/dist/drive/users/index.d.ts +135 -135
- package/dist/drive/users/index.js +208 -204
- package/dist/drive/users/types.d.ts +53 -51
- package/dist/drive/users/types.js +2 -2
- package/dist/index.d.ts +6 -6
- package/dist/index.js +35 -31
- package/dist/network/download.d.ts +8 -8
- package/dist/network/download.js +123 -123
- package/dist/network/errors/codes.d.ts +24 -24
- package/dist/network/errors/codes.js +48 -48
- package/dist/network/errors/context.d.ts +35 -35
- package/dist/network/errors/context.js +39 -39
- package/dist/network/errors/download.d.ts +4 -4
- package/dist/network/errors/download.js +52 -48
- package/dist/network/errors/index.d.ts +3 -3
- package/dist/network/errors/index.js +19 -15
- package/dist/network/errors/upload.d.ts +13 -13
- package/dist/network/errors/upload.js +82 -78
- package/dist/network/index.d.ts +70 -70
- package/dist/network/index.js +315 -311
- package/dist/network/types.d.ts +102 -102
- package/dist/network/types.js +18 -18
- package/dist/network/upload.d.ts +4 -4
- package/dist/network/upload.js +158 -159
- package/dist/photos/devices/index.d.ts +10 -10
- package/dist/photos/devices/index.js +79 -79
- package/dist/photos/index.d.ts +17 -17
- package/dist/photos/index.js +56 -52
- package/dist/photos/photos/index.d.ts +60 -60
- package/dist/photos/photos/index.js +225 -225
- package/dist/photos/shares/index.d.ts +8 -8
- package/dist/photos/shares/index.js +34 -34
- package/dist/photos/types.d.ts +154 -154
- package/dist/photos/types.js +19 -19
- package/dist/photos/users/index.d.ts +7 -7
- package/dist/photos/users/index.js +46 -46
- package/dist/shared/headers/index.d.ts +21 -21
- package/dist/shared/headers/index.js +78 -79
- package/dist/shared/http/client.d.ts +85 -85
- package/dist/shared/http/client.js +172 -172
- package/dist/shared/http/types.d.ts +7 -7
- package/dist/shared/http/types.js +2 -2
- package/dist/shared/index.d.ts +1 -1
- package/dist/shared/index.js +17 -13
- package/dist/shared/types/apiConnection.d.ts +12 -12
- package/dist/shared/types/apiConnection.js +2 -2
- package/dist/shared/types/appsumo.d.ts +16 -16
- package/dist/shared/types/appsumo.js +12 -12
- package/dist/shared/types/errors.d.ts +5 -5
- package/dist/shared/types/errors.js +28 -28
- package/dist/shared/types/teams.d.ts +9 -9
- package/dist/shared/types/teams.js +2 -2
- package/dist/shared/types/userSettings.d.ts +43 -29
- package/dist/shared/types/userSettings.js +2 -2
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +24 -25
- package/dist/workspaces/index.d.ts +176 -176
- package/dist/workspaces/index.js +419 -415
- package/dist/workspaces/index.test.d.ts +1 -1
- package/dist/workspaces/index.test.js +908 -903
- package/dist/workspaces/types.d.ts +294 -291
- package/dist/workspaces/types.js +2 -2
- package/package.json +13 -13
|
@@ -1,176 +1,180 @@
|
|
|
1
|
-
import { AppSumoDetails } from './../../shared/types/appsumo';
|
|
2
|
-
export interface ProductData {
|
|
3
|
-
id: string;
|
|
4
|
-
name: string;
|
|
5
|
-
metadata: ProductMetadata;
|
|
6
|
-
price: ProductPriceData;
|
|
7
|
-
renewalPeriod: RenewalPeriod;
|
|
8
|
-
}
|
|
9
|
-
export interface ProductMetadata {
|
|
10
|
-
is_drive: boolean;
|
|
11
|
-
is_teams: boolean;
|
|
12
|
-
show: boolean;
|
|
13
|
-
lifetime_tier: LifetimeTier;
|
|
14
|
-
member_tier: keyof typeof StripeMemberTiers;
|
|
15
|
-
simple_name: keyof typeof RenewalPeriod;
|
|
16
|
-
size_bytes: string;
|
|
17
|
-
}
|
|
18
|
-
export interface ProductPriceData {
|
|
19
|
-
id: string;
|
|
20
|
-
name: string | null;
|
|
21
|
-
amount: number;
|
|
22
|
-
monthlyAmount: number;
|
|
23
|
-
type: ProductPriceType;
|
|
24
|
-
currency: string;
|
|
25
|
-
recurring: ProductPriceRecurringData | null;
|
|
26
|
-
}
|
|
27
|
-
export interface ProductPriceRecurringData {
|
|
28
|
-
aggregate_usage: string | null;
|
|
29
|
-
interval: string;
|
|
30
|
-
interval_count: number;
|
|
31
|
-
trial_period_days: number;
|
|
32
|
-
usage_type: string;
|
|
33
|
-
}
|
|
34
|
-
export declare enum RenewalPeriod {
|
|
35
|
-
Monthly = "monthly",
|
|
36
|
-
Annually = "annually",
|
|
37
|
-
Lifetime = "lifetime"
|
|
38
|
-
}
|
|
39
|
-
export declare enum LifetimeTier {
|
|
40
|
-
Lifetime = "lifetime",
|
|
41
|
-
Exclusive = "exclusive-lifetime",
|
|
42
|
-
Infinite = "infinite"
|
|
43
|
-
}
|
|
44
|
-
export declare enum StripeSessionMode {
|
|
45
|
-
Payment = "payment",
|
|
46
|
-
Setup = "setup",
|
|
47
|
-
Subscription = "subscription"
|
|
48
|
-
}
|
|
49
|
-
export declare enum StripeMemberTiers {
|
|
50
|
-
'infinite' = 0,
|
|
51
|
-
'lifetime' = 1,
|
|
52
|
-
'premium' = 2
|
|
53
|
-
}
|
|
54
|
-
export declare enum ProductPriceType {
|
|
55
|
-
Recurring = "recurring",
|
|
56
|
-
OneTime = "one_time"
|
|
57
|
-
}
|
|
58
|
-
export declare enum UserType {
|
|
59
|
-
Individual = "individual",
|
|
60
|
-
Business = "business"
|
|
61
|
-
}
|
|
62
|
-
export
|
|
63
|
-
planId: string;
|
|
64
|
-
productId: string;
|
|
65
|
-
name: string;
|
|
66
|
-
simpleName: string;
|
|
67
|
-
paymentInterval: RenewalPeriod;
|
|
68
|
-
price: number;
|
|
69
|
-
monthlyPrice: number;
|
|
70
|
-
currency: string;
|
|
71
|
-
isTeam: boolean;
|
|
72
|
-
isLifetime: boolean;
|
|
73
|
-
renewalPeriod: RenewalPeriod;
|
|
74
|
-
storageLimit: number;
|
|
75
|
-
amountOfSeats: number;
|
|
76
|
-
isAppSumo?: boolean;
|
|
77
|
-
details?: AppSumoDetails;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
created: number;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
export interface
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
export interface
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
export
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
1
|
+
import { AppSumoDetails } from './../../shared/types/appsumo';
|
|
2
|
+
export interface ProductData {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
metadata: ProductMetadata;
|
|
6
|
+
price: ProductPriceData;
|
|
7
|
+
renewalPeriod: RenewalPeriod;
|
|
8
|
+
}
|
|
9
|
+
export interface ProductMetadata {
|
|
10
|
+
is_drive: boolean;
|
|
11
|
+
is_teams: boolean;
|
|
12
|
+
show: boolean;
|
|
13
|
+
lifetime_tier: LifetimeTier;
|
|
14
|
+
member_tier: keyof typeof StripeMemberTiers;
|
|
15
|
+
simple_name: keyof typeof RenewalPeriod;
|
|
16
|
+
size_bytes: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ProductPriceData {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string | null;
|
|
21
|
+
amount: number;
|
|
22
|
+
monthlyAmount: number;
|
|
23
|
+
type: ProductPriceType;
|
|
24
|
+
currency: string;
|
|
25
|
+
recurring: ProductPriceRecurringData | null;
|
|
26
|
+
}
|
|
27
|
+
export interface ProductPriceRecurringData {
|
|
28
|
+
aggregate_usage: string | null;
|
|
29
|
+
interval: string;
|
|
30
|
+
interval_count: number;
|
|
31
|
+
trial_period_days: number;
|
|
32
|
+
usage_type: string;
|
|
33
|
+
}
|
|
34
|
+
export declare enum RenewalPeriod {
|
|
35
|
+
Monthly = "monthly",
|
|
36
|
+
Annually = "annually",
|
|
37
|
+
Lifetime = "lifetime"
|
|
38
|
+
}
|
|
39
|
+
export declare enum LifetimeTier {
|
|
40
|
+
Lifetime = "lifetime",
|
|
41
|
+
Exclusive = "exclusive-lifetime",
|
|
42
|
+
Infinite = "infinite"
|
|
43
|
+
}
|
|
44
|
+
export declare enum StripeSessionMode {
|
|
45
|
+
Payment = "payment",
|
|
46
|
+
Setup = "setup",
|
|
47
|
+
Subscription = "subscription"
|
|
48
|
+
}
|
|
49
|
+
export declare enum StripeMemberTiers {
|
|
50
|
+
'infinite' = 0,
|
|
51
|
+
'lifetime' = 1,
|
|
52
|
+
'premium' = 2
|
|
53
|
+
}
|
|
54
|
+
export declare enum ProductPriceType {
|
|
55
|
+
Recurring = "recurring",
|
|
56
|
+
OneTime = "one_time"
|
|
57
|
+
}
|
|
58
|
+
export declare enum UserType {
|
|
59
|
+
Individual = "individual",
|
|
60
|
+
Business = "business"
|
|
61
|
+
}
|
|
62
|
+
export type StoragePlan = {
|
|
63
|
+
planId: string;
|
|
64
|
+
productId: string;
|
|
65
|
+
name: string;
|
|
66
|
+
simpleName: string;
|
|
67
|
+
paymentInterval: RenewalPeriod;
|
|
68
|
+
price: number;
|
|
69
|
+
monthlyPrice: number;
|
|
70
|
+
currency: string;
|
|
71
|
+
isTeam: boolean;
|
|
72
|
+
isLifetime: boolean;
|
|
73
|
+
renewalPeriod: RenewalPeriod;
|
|
74
|
+
storageLimit: number;
|
|
75
|
+
amountOfSeats: number;
|
|
76
|
+
isAppSumo?: boolean;
|
|
77
|
+
details?: AppSumoDetails;
|
|
78
|
+
seats?: {
|
|
79
|
+
minimumSeats: number;
|
|
80
|
+
maximumSeats: number;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
export interface CreatePaymentSessionPayload {
|
|
84
|
+
test?: boolean;
|
|
85
|
+
lifetime_tier?: LifetimeTier;
|
|
86
|
+
mode: StripeSessionMode;
|
|
87
|
+
priceId: string;
|
|
88
|
+
successUrl?: string;
|
|
89
|
+
canceledUrl?: string;
|
|
90
|
+
}
|
|
91
|
+
export interface StripeAddress {
|
|
92
|
+
city: string | null;
|
|
93
|
+
country: string | null;
|
|
94
|
+
line1: string | null;
|
|
95
|
+
line2: string | null;
|
|
96
|
+
postal_code: string | null;
|
|
97
|
+
state: string | null;
|
|
98
|
+
}
|
|
99
|
+
export interface PaymentMethod {
|
|
100
|
+
id: string;
|
|
101
|
+
billing_details?: {
|
|
102
|
+
address: StripeAddress | null;
|
|
103
|
+
email: string | null;
|
|
104
|
+
name: string | null;
|
|
105
|
+
phone: string | null;
|
|
106
|
+
};
|
|
107
|
+
card: {
|
|
108
|
+
brand: 'amex' | 'diners' | 'discover' | 'jcb' | 'mastercard' | 'unionpay' | 'visa' | 'unknown';
|
|
109
|
+
exp_month: number;
|
|
110
|
+
exp_year: number;
|
|
111
|
+
last4: string;
|
|
112
|
+
};
|
|
113
|
+
created: number;
|
|
114
|
+
}
|
|
115
|
+
export interface Invoice {
|
|
116
|
+
id: string;
|
|
117
|
+
created: number;
|
|
118
|
+
bytesInPlan: number;
|
|
119
|
+
pdf: string;
|
|
120
|
+
total: number;
|
|
121
|
+
currency: string;
|
|
122
|
+
}
|
|
123
|
+
export interface InvoicePayload {
|
|
124
|
+
subscriptionId: string;
|
|
125
|
+
startingAfter?: string;
|
|
126
|
+
limit?: number;
|
|
127
|
+
}
|
|
128
|
+
export type UserSubscription = {
|
|
129
|
+
type: 'free' | 'lifetime';
|
|
130
|
+
} | {
|
|
131
|
+
type: 'subscription';
|
|
132
|
+
subscriptionId: string;
|
|
133
|
+
amount: number;
|
|
134
|
+
currency: string;
|
|
135
|
+
amountAfterCoupon?: number;
|
|
136
|
+
interval: 'year' | 'month';
|
|
137
|
+
nextPayment: number;
|
|
138
|
+
priceId: string;
|
|
139
|
+
userType?: UserType;
|
|
140
|
+
planId?: string;
|
|
141
|
+
plan?: StoragePlan;
|
|
142
|
+
};
|
|
143
|
+
export interface DisplayPrice {
|
|
144
|
+
id: string;
|
|
145
|
+
bytes: number;
|
|
146
|
+
interval: 'year' | 'month' | 'lifetime';
|
|
147
|
+
amount: number;
|
|
148
|
+
currency: string;
|
|
149
|
+
userType: UserType;
|
|
150
|
+
}
|
|
151
|
+
export interface CreateCheckoutSessionPayload {
|
|
152
|
+
price_id: string;
|
|
153
|
+
coupon_code?: string;
|
|
154
|
+
trial_days?: number;
|
|
155
|
+
success_url: string;
|
|
156
|
+
cancel_url: string;
|
|
157
|
+
customer_email: string;
|
|
158
|
+
currency?: string;
|
|
159
|
+
}
|
|
160
|
+
export interface FreeTrialAvailable {
|
|
161
|
+
elegible: boolean;
|
|
162
|
+
}
|
|
163
|
+
export interface RedeemCodePayload {
|
|
164
|
+
code: string;
|
|
165
|
+
provider: string;
|
|
166
|
+
}
|
|
167
|
+
export interface UpdateSubscriptionPaymentMethod {
|
|
168
|
+
userType: UserType;
|
|
169
|
+
paymentMethodId: string;
|
|
170
|
+
}
|
|
171
|
+
export interface CustomerBillingInfo {
|
|
172
|
+
address?: string;
|
|
173
|
+
phoneNumber?: string;
|
|
174
|
+
}
|
|
175
|
+
export type CreatedSubscriptionData = {
|
|
176
|
+
type: 'setup' | 'payment';
|
|
177
|
+
clientSecret: string;
|
|
178
|
+
subscriptionId?: string;
|
|
179
|
+
paymentIntentId?: string;
|
|
180
|
+
};
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UserType = exports.ProductPriceType = exports.StripeMemberTiers = exports.StripeSessionMode = exports.LifetimeTier = exports.RenewalPeriod = void 0;
|
|
4
|
-
var RenewalPeriod;
|
|
5
|
-
(function (RenewalPeriod) {
|
|
6
|
-
RenewalPeriod["Monthly"] = "monthly";
|
|
7
|
-
RenewalPeriod["Annually"] = "annually";
|
|
8
|
-
RenewalPeriod["Lifetime"] = "lifetime";
|
|
9
|
-
})(RenewalPeriod
|
|
10
|
-
var LifetimeTier;
|
|
11
|
-
(function (LifetimeTier) {
|
|
12
|
-
LifetimeTier["Lifetime"] = "lifetime";
|
|
13
|
-
LifetimeTier["Exclusive"] = "exclusive-lifetime";
|
|
14
|
-
LifetimeTier["Infinite"] = "infinite";
|
|
15
|
-
})(LifetimeTier
|
|
16
|
-
var StripeSessionMode;
|
|
17
|
-
(function (StripeSessionMode) {
|
|
18
|
-
StripeSessionMode["Payment"] = "payment";
|
|
19
|
-
StripeSessionMode["Setup"] = "setup";
|
|
20
|
-
StripeSessionMode["Subscription"] = "subscription";
|
|
21
|
-
})(StripeSessionMode
|
|
22
|
-
var StripeMemberTiers;
|
|
23
|
-
(function (StripeMemberTiers) {
|
|
24
|
-
StripeMemberTiers[StripeMemberTiers["infinite"] = 0] = "infinite";
|
|
25
|
-
StripeMemberTiers[StripeMemberTiers["lifetime"] = 1] = "lifetime";
|
|
26
|
-
StripeMemberTiers[StripeMemberTiers["premium"] = 2] = "premium";
|
|
27
|
-
})(StripeMemberTiers
|
|
28
|
-
var ProductPriceType;
|
|
29
|
-
(function (ProductPriceType) {
|
|
30
|
-
ProductPriceType["Recurring"] = "recurring";
|
|
31
|
-
ProductPriceType["OneTime"] = "one_time";
|
|
32
|
-
})(ProductPriceType
|
|
33
|
-
var UserType;
|
|
34
|
-
(function (UserType) {
|
|
35
|
-
UserType["Individual"] = "individual";
|
|
36
|
-
UserType["Business"] = "business";
|
|
37
|
-
})(UserType
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserType = exports.ProductPriceType = exports.StripeMemberTiers = exports.StripeSessionMode = exports.LifetimeTier = exports.RenewalPeriod = void 0;
|
|
4
|
+
var RenewalPeriod;
|
|
5
|
+
(function (RenewalPeriod) {
|
|
6
|
+
RenewalPeriod["Monthly"] = "monthly";
|
|
7
|
+
RenewalPeriod["Annually"] = "annually";
|
|
8
|
+
RenewalPeriod["Lifetime"] = "lifetime";
|
|
9
|
+
})(RenewalPeriod || (exports.RenewalPeriod = RenewalPeriod = {}));
|
|
10
|
+
var LifetimeTier;
|
|
11
|
+
(function (LifetimeTier) {
|
|
12
|
+
LifetimeTier["Lifetime"] = "lifetime";
|
|
13
|
+
LifetimeTier["Exclusive"] = "exclusive-lifetime";
|
|
14
|
+
LifetimeTier["Infinite"] = "infinite";
|
|
15
|
+
})(LifetimeTier || (exports.LifetimeTier = LifetimeTier = {}));
|
|
16
|
+
var StripeSessionMode;
|
|
17
|
+
(function (StripeSessionMode) {
|
|
18
|
+
StripeSessionMode["Payment"] = "payment";
|
|
19
|
+
StripeSessionMode["Setup"] = "setup";
|
|
20
|
+
StripeSessionMode["Subscription"] = "subscription";
|
|
21
|
+
})(StripeSessionMode || (exports.StripeSessionMode = StripeSessionMode = {}));
|
|
22
|
+
var StripeMemberTiers;
|
|
23
|
+
(function (StripeMemberTiers) {
|
|
24
|
+
StripeMemberTiers[StripeMemberTiers["infinite"] = 0] = "infinite";
|
|
25
|
+
StripeMemberTiers[StripeMemberTiers["lifetime"] = 1] = "lifetime";
|
|
26
|
+
StripeMemberTiers[StripeMemberTiers["premium"] = 2] = "premium";
|
|
27
|
+
})(StripeMemberTiers || (exports.StripeMemberTiers = StripeMemberTiers = {}));
|
|
28
|
+
var ProductPriceType;
|
|
29
|
+
(function (ProductPriceType) {
|
|
30
|
+
ProductPriceType["Recurring"] = "recurring";
|
|
31
|
+
ProductPriceType["OneTime"] = "one_time";
|
|
32
|
+
})(ProductPriceType || (exports.ProductPriceType = ProductPriceType = {}));
|
|
33
|
+
var UserType;
|
|
34
|
+
(function (UserType) {
|
|
35
|
+
UserType["Individual"] = "individual";
|
|
36
|
+
UserType["Business"] = "business";
|
|
37
|
+
})(UserType || (exports.UserType = UserType = {}));
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { ApiSecurity, ApiUrl, AppDetails } from '../../shared';
|
|
2
|
-
import { UserReferral } from './types';
|
|
3
|
-
export * as ReferralTypes from './types';
|
|
4
|
-
export declare class Referrals {
|
|
5
|
-
private readonly client;
|
|
6
|
-
private readonly appDetails;
|
|
7
|
-
private readonly apiSecurity;
|
|
8
|
-
static client(apiUrl: ApiUrl, appDetails: AppDetails, apiSecurity: ApiSecurity): Referrals;
|
|
9
|
-
private constructor();
|
|
10
|
-
/**
|
|
11
|
-
* Returns a list of referrals of this user
|
|
12
|
-
*/
|
|
13
|
-
getReferrals(): Promise<UserReferral[]>;
|
|
14
|
-
/**
|
|
15
|
-
* Returns the needed headers for the module requests
|
|
16
|
-
* @private
|
|
17
|
-
*/
|
|
18
|
-
private headers;
|
|
19
|
-
}
|
|
1
|
+
import { ApiSecurity, ApiUrl, AppDetails } from '../../shared';
|
|
2
|
+
import { UserReferral } from './types';
|
|
3
|
+
export * as ReferralTypes from './types';
|
|
4
|
+
export declare class Referrals {
|
|
5
|
+
private readonly client;
|
|
6
|
+
private readonly appDetails;
|
|
7
|
+
private readonly apiSecurity;
|
|
8
|
+
static client(apiUrl: ApiUrl, appDetails: AppDetails, apiSecurity: ApiSecurity): Referrals;
|
|
9
|
+
private constructor();
|
|
10
|
+
/**
|
|
11
|
+
* Returns a list of referrals of this user
|
|
12
|
+
*/
|
|
13
|
+
getReferrals(): Promise<UserReferral[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Returns the needed headers for the module requests
|
|
16
|
+
* @private
|
|
17
|
+
*/
|
|
18
|
+
private headers;
|
|
19
|
+
}
|
|
@@ -1,50 +1,54 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
exports
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.Referrals = exports.ReferralTypes = void 0;
|
|
27
|
+
var headers_1 = require("../../shared/headers");
|
|
28
|
+
var client_1 = require("../../shared/http/client");
|
|
29
|
+
exports.ReferralTypes = __importStar(require("./types"));
|
|
30
|
+
var Referrals = /** @class */ (function () {
|
|
31
|
+
function Referrals(apiUrl, appDetails, apiSecurity) {
|
|
32
|
+
this.client = client_1.HttpClient.create(apiUrl, apiSecurity.unauthorizedCallback);
|
|
33
|
+
this.appDetails = appDetails;
|
|
34
|
+
this.apiSecurity = apiSecurity;
|
|
35
|
+
}
|
|
36
|
+
Referrals.client = function (apiUrl, appDetails, apiSecurity) {
|
|
37
|
+
return new Referrals(apiUrl, appDetails, apiSecurity);
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Returns a list of referrals of this user
|
|
41
|
+
*/
|
|
42
|
+
Referrals.prototype.getReferrals = function () {
|
|
43
|
+
return this.client.get('/users-referrals', this.headers());
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Returns the needed headers for the module requests
|
|
47
|
+
* @private
|
|
48
|
+
*/
|
|
49
|
+
Referrals.prototype.headers = function () {
|
|
50
|
+
return (0, headers_1.headersWithToken)(this.appDetails.clientName, this.appDetails.clientVersion, this.apiSecurity.token);
|
|
51
|
+
};
|
|
52
|
+
return Referrals;
|
|
53
|
+
}());
|
|
54
|
+
exports.Referrals = Referrals;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export declare enum ReferralType {
|
|
2
|
-
Storage = "storage"
|
|
3
|
-
}
|
|
4
|
-
export declare enum ReferralKey {
|
|
5
|
-
CreateAccount = "create-account",
|
|
6
|
-
InstallMobileApp = "install-mobile-app",
|
|
7
|
-
ShareFile = "share-file",
|
|
8
|
-
SubscribeToNewsletter = "subscribe-to-newsletter",
|
|
9
|
-
InstallDesktopApp = "install-desktop-app",
|
|
10
|
-
InviteFriends = "invite-friends",
|
|
11
|
-
Invite2Friends = "invite-2-friends",
|
|
12
|
-
CompleteSurvey = "complete-survey"
|
|
13
|
-
}
|
|
14
|
-
export interface UserReferral {
|
|
15
|
-
key: ReferralKey;
|
|
16
|
-
steps: number;
|
|
17
|
-
completedSteps: number;
|
|
18
|
-
isCompleted: boolean;
|
|
19
|
-
credit: number;
|
|
20
|
-
type: ReferralType;
|
|
21
|
-
}
|
|
1
|
+
export declare enum ReferralType {
|
|
2
|
+
Storage = "storage"
|
|
3
|
+
}
|
|
4
|
+
export declare enum ReferralKey {
|
|
5
|
+
CreateAccount = "create-account",
|
|
6
|
+
InstallMobileApp = "install-mobile-app",
|
|
7
|
+
ShareFile = "share-file",
|
|
8
|
+
SubscribeToNewsletter = "subscribe-to-newsletter",
|
|
9
|
+
InstallDesktopApp = "install-desktop-app",
|
|
10
|
+
InviteFriends = "invite-friends",
|
|
11
|
+
Invite2Friends = "invite-2-friends",
|
|
12
|
+
CompleteSurvey = "complete-survey"
|
|
13
|
+
}
|
|
14
|
+
export interface UserReferral {
|
|
15
|
+
key: ReferralKey;
|
|
16
|
+
steps: number;
|
|
17
|
+
completedSteps: number;
|
|
18
|
+
isCompleted: boolean;
|
|
19
|
+
credit: number;
|
|
20
|
+
type: ReferralType;
|
|
21
|
+
}
|