@internxt/sdk 1.15.14 → 1.16.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.
- package/dist/auth/index.js +180 -262
- package/dist/auth/types.js +2 -22
- package/dist/drive/backups/index.js +34 -32
- package/dist/drive/payments/index.js +96 -149
- package/dist/drive/payments/object-storage.js +34 -36
- package/dist/drive/referrals/index.js +19 -17
- package/dist/drive/share/index.js +168 -235
- package/dist/drive/storage/index.js +213 -302
- package/dist/drive/trash/index.js +40 -84
- package/dist/drive/users/index.js +95 -140
- package/dist/mail/index.d.ts +124 -2
- package/dist/mail/index.js +170 -16
- package/dist/mail/types.d.ts +50 -0
- package/dist/mail/types.js +6 -0
- package/dist/meet/index.js +31 -99
- package/dist/misc/location/index.js +10 -50
- package/dist/network/download.js +38 -107
- package/dist/network/errors/codes.js +8 -24
- package/dist/network/errors/context.js +9 -26
- package/dist/network/errors/download.js +6 -24
- package/dist/network/errors/upload.js +21 -48
- package/dist/network/index.js +120 -277
- package/dist/network/types.js +3 -4
- package/dist/network/upload.js +63 -133
- package/dist/payments/checkout.js +57 -69
- package/dist/send/send.js +17 -27
- package/dist/shared/headers/index.js +56 -42
- package/dist/shared/http/client.js +95 -207
- package/dist/shared/http/retryWithBackoff.js +36 -110
- package/dist/shared/types/errors.js +37 -51
- package/dist/workspaces/index.js +224 -264
- package/package.json +14 -15
- package/dist/mail/api.d.ts +0 -126
- package/dist/mail/api.js +0 -288
- package/dist/mail/crypto.d.ts +0 -66
- package/dist/mail/crypto.js +0 -156
- package/dist/mail/mail.d.ts +0 -162
- package/dist/mail/mail.js +0 -382
|
@@ -34,41 +34,44 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.Referrals = exports.ReferralTypes = void 0;
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
const headers_1 = require("../../shared/headers");
|
|
38
|
+
const client_1 = require("../../shared/http/client");
|
|
39
39
|
exports.ReferralTypes = __importStar(require("./types"));
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
class Referrals {
|
|
41
|
+
client;
|
|
42
|
+
appDetails;
|
|
43
|
+
apiSecurity;
|
|
44
|
+
static client(apiUrl, appDetails, apiSecurity) {
|
|
45
|
+
return new Referrals(apiUrl, appDetails, apiSecurity);
|
|
46
|
+
}
|
|
47
|
+
constructor(apiUrl, appDetails, apiSecurity) {
|
|
42
48
|
this.client = client_1.HttpClient.create(apiUrl, apiSecurity.unauthorizedCallback, apiSecurity.retryOptions);
|
|
43
49
|
this.appDetails = appDetails;
|
|
44
50
|
this.apiSecurity = apiSecurity;
|
|
45
51
|
}
|
|
46
|
-
Referrals.client = function (apiUrl, appDetails, apiSecurity) {
|
|
47
|
-
return new Referrals(apiUrl, appDetails, apiSecurity);
|
|
48
|
-
};
|
|
49
52
|
/**
|
|
50
53
|
* Returns a list of referrals of this user
|
|
51
54
|
*/
|
|
52
|
-
|
|
55
|
+
getReferrals() {
|
|
53
56
|
return this.client.get('/users-referrals', this.headers());
|
|
54
|
-
}
|
|
57
|
+
}
|
|
55
58
|
/**
|
|
56
59
|
* Generates a referral token for the authenticated user
|
|
57
60
|
*/
|
|
58
|
-
|
|
61
|
+
createReferralToken() {
|
|
59
62
|
return this.client.post('/referral/token', {}, this.headers());
|
|
60
|
-
}
|
|
63
|
+
}
|
|
61
64
|
/**
|
|
62
65
|
* Checks if the referral feature is enabled for the authenticated user
|
|
63
66
|
*/
|
|
64
|
-
|
|
67
|
+
isReferralEnabled() {
|
|
65
68
|
return this.client.get('/referral/enabled', this.headers());
|
|
66
|
-
}
|
|
69
|
+
}
|
|
67
70
|
/**
|
|
68
71
|
* Returns the needed headers for the module requests
|
|
69
72
|
* @private
|
|
70
73
|
*/
|
|
71
|
-
|
|
74
|
+
headers() {
|
|
72
75
|
return (0, headers_1.headersWithToken)({
|
|
73
76
|
clientName: this.appDetails.clientName,
|
|
74
77
|
clientVersion: this.appDetails.clientVersion,
|
|
@@ -77,7 +80,6 @@ var Referrals = /** @class */ (function () {
|
|
|
77
80
|
desktopToken: this.appDetails.desktopHeader,
|
|
78
81
|
customHeaders: this.appDetails.customHeaders,
|
|
79
82
|
});
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
}());
|
|
83
|
+
}
|
|
84
|
+
}
|
|
83
85
|
exports.Referrals = Referrals;
|