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