@internxt/sdk 1.9.6 → 1.9.8
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 +11 -0
- package/dist/auth/index.js +19 -0
- package/dist/drive/payments/index.d.ts +6 -1
- package/dist/drive/payments/index.js +7 -0
- package/dist/drive/payments/types.d.ts +5 -0
- package/dist/drive/users/index.d.ts +21 -0
- package/dist/drive/users/index.js +28 -0
- package/package.json +1 -1
package/dist/auth/index.d.ts
CHANGED
|
@@ -84,15 +84,26 @@ export declare class Auth {
|
|
|
84
84
|
*/
|
|
85
85
|
storeTwoFactorAuthKey(backupKey: string, code: string, token?: Token): Promise<void>;
|
|
86
86
|
/**
|
|
87
|
+
* @deprecated Use `sendUserDeactivationEmail` instead.
|
|
87
88
|
* Sends request to send the email to delete the account
|
|
88
89
|
* @param email
|
|
89
90
|
*/
|
|
90
91
|
sendDeactivationEmail(email: string): Promise<void>;
|
|
91
92
|
/**
|
|
93
|
+
* Sends request to send the email to delete the account
|
|
94
|
+
*/
|
|
95
|
+
sendUserDeactivationEmail(token?: Token): Promise<void>;
|
|
96
|
+
/**
|
|
97
|
+
* @deprecated Use `confirmUserDeactivation` instead.
|
|
92
98
|
* Confirms the account deactivation
|
|
93
99
|
* @param token
|
|
94
100
|
*/
|
|
95
101
|
confirmDeactivation(token: string): Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* Confirms the account deactivation
|
|
104
|
+
* @param token
|
|
105
|
+
*/
|
|
106
|
+
confirmUserDeactivation(deactivationToken: string, token?: string): Promise<void>;
|
|
96
107
|
/**
|
|
97
108
|
* Check credentials
|
|
98
109
|
* @param hashedPassword
|
package/dist/auth/index.js
CHANGED
|
@@ -287,6 +287,7 @@ var Auth = /** @class */ (function () {
|
|
|
287
287
|
}, this.headersWithToken(token !== null && token !== void 0 ? token : (_a = this.apiSecurity) === null || _a === void 0 ? void 0 : _a.token));
|
|
288
288
|
};
|
|
289
289
|
/**
|
|
290
|
+
* @deprecated Use `sendUserDeactivationEmail` instead.
|
|
290
291
|
* Sends request to send the email to delete the account
|
|
291
292
|
* @param email
|
|
292
293
|
*/
|
|
@@ -294,12 +295,30 @@ var Auth = /** @class */ (function () {
|
|
|
294
295
|
return this.client.get("/deactivate/".concat(email), this.basicHeaders());
|
|
295
296
|
};
|
|
296
297
|
/**
|
|
298
|
+
* Sends request to send the email to delete the account
|
|
299
|
+
*/
|
|
300
|
+
Auth.prototype.sendUserDeactivationEmail = function (token) {
|
|
301
|
+
var _a;
|
|
302
|
+
return this.client.post('/users/deactivation/send', {}, this.headersWithToken(token !== null && token !== void 0 ? token : (_a = this.apiSecurity) === null || _a === void 0 ? void 0 : _a.token));
|
|
303
|
+
};
|
|
304
|
+
/**
|
|
305
|
+
* @deprecated Use `confirmUserDeactivation` instead.
|
|
297
306
|
* Confirms the account deactivation
|
|
298
307
|
* @param token
|
|
299
308
|
*/
|
|
300
309
|
Auth.prototype.confirmDeactivation = function (token) {
|
|
301
310
|
return this.client.get("/confirmDeactivation/".concat(token), this.basicHeaders());
|
|
302
311
|
};
|
|
312
|
+
/**
|
|
313
|
+
* Confirms the account deactivation
|
|
314
|
+
* @param token
|
|
315
|
+
*/
|
|
316
|
+
Auth.prototype.confirmUserDeactivation = function (deactivationToken, token) {
|
|
317
|
+
var _a;
|
|
318
|
+
return this.client.post('/users/deactivation/confirm', {
|
|
319
|
+
token: deactivationToken,
|
|
320
|
+
}, this.headersWithToken(token !== null && token !== void 0 ? token : (_a = this.apiSecurity) === null || _a === void 0 ? void 0 : _a.token));
|
|
321
|
+
};
|
|
303
322
|
/**
|
|
304
323
|
* Check credentials
|
|
305
324
|
* @param hashedPassword
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiSecurity, ApiUrl, AppDetails } from '../../shared';
|
|
2
|
-
import { CreateCheckoutSessionPayload, CreatedSubscriptionData, CreatePaymentSessionPayload, CustomerBillingInfo, DisplayPrice, FreeTrialAvailable, Invoice, InvoicePayload, PaymentMethod, ProductData, RedeemCodePayload, UpdateSubscriptionPaymentMethod, UserSubscription, UserType } from './types';
|
|
2
|
+
import { AvailableProducts, CreateCheckoutSessionPayload, CreatedSubscriptionData, CreatePaymentSessionPayload, CustomerBillingInfo, DisplayPrice, FreeTrialAvailable, Invoice, InvoicePayload, PaymentMethod, ProductData, RedeemCodePayload, UpdateSubscriptionPaymentMethod, UserSubscription, UserType } from './types';
|
|
3
3
|
export declare class Payments {
|
|
4
4
|
private readonly client;
|
|
5
5
|
private readonly appDetails;
|
|
@@ -58,6 +58,11 @@ export declare class Payments {
|
|
|
58
58
|
sessionId: string;
|
|
59
59
|
}>;
|
|
60
60
|
updateCustomerBillingInfo(payload: CustomerBillingInfo): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Gets the available products from the user
|
|
63
|
+
* @returns an object containing available products
|
|
64
|
+
*/
|
|
65
|
+
checkUserAvailableProducts(): Promise<AvailableProducts>;
|
|
61
66
|
/**
|
|
62
67
|
* Returns the needed headers for the module requests
|
|
63
68
|
* @private
|
|
@@ -197,6 +197,13 @@ var Payments = /** @class */ (function () {
|
|
|
197
197
|
Payments.prototype.updateCustomerBillingInfo = function (payload) {
|
|
198
198
|
return this.client.patch('/billing', __assign({}, payload), this.headers());
|
|
199
199
|
};
|
|
200
|
+
/**
|
|
201
|
+
* Gets the available products from the user
|
|
202
|
+
* @returns an object containing available products
|
|
203
|
+
*/
|
|
204
|
+
Payments.prototype.checkUserAvailableProducts = function () {
|
|
205
|
+
return this.client.get('/products', this.headers());
|
|
206
|
+
};
|
|
200
207
|
/**
|
|
201
208
|
* Returns the needed headers for the module requests
|
|
202
209
|
* @private
|
|
@@ -70,11 +70,18 @@ export declare class Users {
|
|
|
70
70
|
*/
|
|
71
71
|
preRegister(email: string): Promise<PreCreateUserResponse>;
|
|
72
72
|
/**
|
|
73
|
+
* @deprecated Use `updateUserProfile` instead.
|
|
73
74
|
* Updates a user profile
|
|
74
75
|
* @param payload
|
|
75
76
|
*/
|
|
76
77
|
updateProfile(payload: UpdateProfilePayload): Promise<void>;
|
|
77
78
|
/**
|
|
79
|
+
* Updates a user profile
|
|
80
|
+
* @param payload
|
|
81
|
+
*/
|
|
82
|
+
updateUserProfile(payload: UpdateProfilePayload, token?: Token): Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* @deprecated Use `updateUserAvatar` instead.
|
|
78
85
|
* Updates a user avatar
|
|
79
86
|
* @param payload
|
|
80
87
|
*/
|
|
@@ -84,9 +91,23 @@ export declare class Users {
|
|
|
84
91
|
avatar: string;
|
|
85
92
|
}>;
|
|
86
93
|
/**
|
|
94
|
+
* Updates a user avatar
|
|
95
|
+
* @param payload
|
|
96
|
+
*/
|
|
97
|
+
updateUserAvatar(payload: {
|
|
98
|
+
avatar: Blob;
|
|
99
|
+
}, token?: Token): Promise<{
|
|
100
|
+
avatar: string;
|
|
101
|
+
}>;
|
|
102
|
+
/**
|
|
103
|
+
* @deprecated Use `deleteUserAvatar` instead.
|
|
87
104
|
* Delete current user avatar
|
|
88
105
|
*/
|
|
89
106
|
deleteAvatar(): Promise<void>;
|
|
107
|
+
/**
|
|
108
|
+
* Delete current user avatar
|
|
109
|
+
*/
|
|
110
|
+
deleteUserAvatar(token?: Token): Promise<void>;
|
|
90
111
|
/**
|
|
91
112
|
* Gets all friend invites created by this user
|
|
92
113
|
*/
|
|
@@ -123,6 +123,7 @@ var Users = /** @class */ (function () {
|
|
|
123
123
|
}, this.headers());
|
|
124
124
|
};
|
|
125
125
|
/**
|
|
126
|
+
* @deprecated Use `updateUserProfile` instead.
|
|
126
127
|
* Updates a user profile
|
|
127
128
|
* @param payload
|
|
128
129
|
*/
|
|
@@ -130,6 +131,15 @@ var Users = /** @class */ (function () {
|
|
|
130
131
|
return this.client.patch('/user/profile', payload, this.headers());
|
|
131
132
|
};
|
|
132
133
|
/**
|
|
134
|
+
* Updates a user profile
|
|
135
|
+
* @param payload
|
|
136
|
+
*/
|
|
137
|
+
Users.prototype.updateUserProfile = function (payload, token) {
|
|
138
|
+
var _a;
|
|
139
|
+
return this.client.patch('/users/profile', payload, this.headersWithToken(token !== null && token !== void 0 ? token : (_a = this.apiSecurity) === null || _a === void 0 ? void 0 : _a.token));
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* @deprecated Use `updateUserAvatar` instead.
|
|
133
143
|
* Updates a user avatar
|
|
134
144
|
* @param payload
|
|
135
145
|
*/
|
|
@@ -139,11 +149,29 @@ var Users = /** @class */ (function () {
|
|
|
139
149
|
return this.client.put('/user/avatar', formData, this.headers());
|
|
140
150
|
};
|
|
141
151
|
/**
|
|
152
|
+
* Updates a user avatar
|
|
153
|
+
* @param payload
|
|
154
|
+
*/
|
|
155
|
+
Users.prototype.updateUserAvatar = function (payload, token) {
|
|
156
|
+
var _a;
|
|
157
|
+
var formData = new FormData();
|
|
158
|
+
formData.set('avatar', payload.avatar);
|
|
159
|
+
return this.client.put('/users/avatar', formData, this.headersWithToken(token !== null && token !== void 0 ? token : (_a = this.apiSecurity) === null || _a === void 0 ? void 0 : _a.token));
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* @deprecated Use `deleteUserAvatar` instead.
|
|
142
163
|
* Delete current user avatar
|
|
143
164
|
*/
|
|
144
165
|
Users.prototype.deleteAvatar = function () {
|
|
145
166
|
return this.client.delete('/user/avatar', this.headers());
|
|
146
167
|
};
|
|
168
|
+
/**
|
|
169
|
+
* Delete current user avatar
|
|
170
|
+
*/
|
|
171
|
+
Users.prototype.deleteUserAvatar = function (token) {
|
|
172
|
+
var _a;
|
|
173
|
+
return this.client.delete('/users/avatar', this.headersWithToken(token !== null && token !== void 0 ? token : (_a = this.apiSecurity) === null || _a === void 0 ? void 0 : _a.token));
|
|
174
|
+
};
|
|
147
175
|
/**
|
|
148
176
|
* Gets all friend invites created by this user
|
|
149
177
|
*/
|